Discover the benefits of self-hosting free budgeting apps with this guide. Learn how to install the Actual Budget app using Docker and set up the Caddy web server to host the app.
Prerequisites
Before starting, ensure you have Docker and Docker Compose installed on your system. If you don't have them installed, follow the instructions on the official Docker website and the official Docker Compose website.
Step 1: Choose a Data Directory
Determine the directory on your host machine where you want to store your self-hosted free budgeting app's data, such as your database and configuration files. Remember the path to this directory, as you will need it in the next step.
Step 2: Run Actual Budget with Docker
Open a terminal or command prompt on your system and enter the following command, replacing YOUR/PATH/TO/DATA
with the path to your chosen data directory:
docker run --pull=always --restart=unless-stopped -d -p 5006:5006 -v YOUR/PATH/TO/DATA:/data --name my_actual_budget actualbudget/actual-server:latest
This command performs the following actions:
- Automatically pulls the latest version of the Actual Budget server image.
- Restarts the container unless it was manually stopped.
- Runs the container in detached mode (in the background).
- Maps port 5006 on the host to port 5006 on the container.
- Mounts the specified host directory as a volume to store your data.
- Assigns the container the name "my_actual_budget."
After executing this command, Docker will download and run the Actual Budget container, making your self-hosted free budgeting app accessible on port 5006.
Step 3: Configure Caddy
Create a new directory for your Caddy configuration files, data, and logs, for example:
mkdir -p /data/apps/caddy/caddy_config /data/apps/caddy/caddy_data /data/apps/caddy/caddy_logs
Navigate to the Caddy directory:
cd /data/apps/caddy
Create a new Caddyfile
with the following content, replacing your-domain.com
with your actual domain name:
your-domain.com {
reverse_proxy localhost:5006
}
This configuration file tells Caddy to proxy requests from your-domain.com
to the Actual Budget app running on localhost:5006
, allowing you to access your self-hosted free budgeting app.
Step 4: Create a Docker Compose File for Caddy
In the same directory, create a docker-compose.yml
file with the following content:
version: "3.9"
services:
caddy:
image: caddy:latest
container_name: caddy
restart: unless-stopped
networks:
- knob-net
- private-net
ports:
- "80:80"
- "443:443"
- "443:443/udp"
volumes:
- $PWD/Caddyfile:/etc/caddy/Caddyfile
- $PWD/site:/srv
- ./caddy_data:/data
- ./caddy_config:/config
- ./caddy_logs:/var/log/caddy
This Docker Compose file defines a Caddy service that:
- Pulls the latest Caddy image.
- Assigns the container the name "caddy."
- Restarts the container unless it was manually stopped.
- Connects to the specified networks.
- Maps the host ports to the container ports.
- Mounts the specified volumes for configuration, data, and logs.