Self-host Wallos with Docker Compose
Personal subscription tracker for keeping recurring costs and renewal dates in view.
wallos
wallos-backups-init
busybox
wallos-db-init
busybox
wallos-logos-init
busybox
wallos-tmp-init
busybox
The steps below take a few minutes end to end.
Requirements
You'll need these installed on the machine you're deploying to:
Docker
Packages Wallos and everything it depends on into an isolated container, so it runs the same way on your machine as it does everywhere else.
Install guideDocker Compose
Reads docker-compose.yml and starts everything in it together. Ships with Docker Desktop. On Linux servers it's usually a separate install.
Install guide1. Docker compose setup and file
Create a folder for Wallos and save the file below into it as docker-compose.yml. It describes every container the stack needs — Wallos itself and any supporting services, such as its database — along with the ports, volumes and environment variables each one uses. You'll also need an empty .env file in the same folder; Docker Compose reads it automatically and uses it to fill in the ${VARIABLE} references you'll see in the file below.
docker-compose.yml
version: "3.9"
services:
wallos:
image: bellamy/wallos:latest
restart: unless-stopped
ports:
- 8080:8080
environment:
TZ: UTC
volumes:
- db:/var/www/html/db
- logos:/var/www/html/images/uploads/logos
- backups:/var/www/html/.tmp
- tmp:/tmp
depends_on:
wallos-backups-init:
condition: service_completed_successfully
wallos-db-init:
condition: service_completed_successfully
wallos-logos-init:
condition: service_completed_successfully
wallos-tmp-init:
condition: service_completed_successfully
entrypoint:
- /bin/sh
- -c
- |
set -e
cd /var/www/html
mkdir -p /tmp/nginx images/uploads/logos/avatars .tmp
cat > /tmp/nginx.conf <<'CONF'
worker_processes 1;
pid /tmp/nginx.pid;
error_log /dev/stderr warn;
events { worker_connections 1024; }
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log off;
sendfile on;
client_max_body_size 256M;
client_body_temp_path /tmp/nginx/body;
proxy_temp_path /tmp/nginx/proxy;
fastcgi_temp_path /tmp/nginx/fastcgi;
uwsgi_temp_path /tmp/nginx/uwsgi;
scgi_temp_path /tmp/nginx/scgi;
server {
listen 8080;
root /var/www/html;
index index.php;
location / { try_files $$uri $$uri/ /index.php?$$args; }
location ~ \.db$$ { deny all; return 403; }
location ~* images/uploads/logos/.*\.php$$ { deny all; return 403; }
location ^~ /.tmp/ { deny all; return 403; }
location ~* ^/includes/.*\.php$$ { deny all; return 403; }
location ~ \.php$$ {
include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $$document_root$$fastcgi_script_name;
}
}
}
CONF
php endpoints/cronjobs/createdatabase.php
php endpoints/db/migrate.php
php endpoints/cronjobs/updatenextpayment.php || true
php endpoints/cronjobs/updateexchange.php || true
(
while true; do
sleep 3600
for job in updatenextpayment updateexchange sendcancellationnotifications sendnotifications \
sendverificationemails sendresetpasswordemails cleanupresettokens; do
php endpoints/cronjobs/$$job.php > /dev/null 2>&1 || true
done
done
) &
php-fpm -F &
exec nginx -e /dev/stderr -c /tmp/nginx.conf -g 'daemon off;'
wallos-backups-init:
image: busybox
volumes:
- backups:/var/www/html/.tmp
command:
- chown
- 82:82
- /var/www/html/.tmp
wallos-db-init:
image: busybox
volumes:
- db:/var/www/html/db
command:
- chown
- 82:82
- /var/www/html/db
wallos-logos-init:
image: busybox
volumes:
- logos:/var/www/html/images/uploads/logos
command:
- chown
- 82:82
- /var/www/html/images/uploads/logos
wallos-tmp-init:
image: busybox
volumes:
- tmp:/tmp
command:
- chown
- 82:82
- /tmp
volumes:
backups: null
db: null
logos: null
tmp: null
Volumes
Wallos stores its data in named Docker volumes, so it survives container restarts and updates:
- db mounted at /var/www/html/db: Wallos's SQLite database with your subscriptions, categories, payment methods, and settings.
- logos mounted at /var/www/html/images/uploads/logos: Subscription logos and user avatars you upload or fetch.
- backups mounted at /var/www/html/.tmp: Working space for creating and restoring database backups.
- tmp mounted at /tmp: PHP session files, generated web server configuration, and upload buffers.
2. Start Wallos with Docker Compose
From the folder with docker-compose.yml and .env, run:
Terminal
Start Wallos and all its supporting services in the background.
docker compose up -dThe -d flag runs the stack in the background so it keeps running after you close the terminal. Docker will pull the images the first time, which can take a minute or two.
To check on it afterwards: docker compose ps shows whether containers are healthy, and docker compose logs -f follows their logs if something looks wrong. Once it's running, open http://localhost:8080 in your browser.