Manual install with Docker

Docker mode, step by step, without the script.

These are the steps of Docker mode, done by hand. Use them when you do not want to run the script, or to see what the script does.

In the examples, the domain is zerodot.example.com and the install folder is /var/www/zerodot.

1. DNS

Add this record:

A  zerodot.example.com  <server IPv4 address>

With the Cloudflare proxy, see Cloudflare proxy. With a Cloudflare Tunnel, skip this step.

2. Install the base packages

Debian and Ubuntu:

sudo apt update
sudo apt install -y git curl openssl ca-certificates

Fedora, RHEL, Rocky and Alma:

sudo dnf install -y git curl openssl ca-certificates

Arch:

sudo pacman -S --needed git curl openssl ca-certificates

3. Install Docker

You need Docker Engine and Docker Compose 2.24 or newer. Check the versions that you have:

docker version --format '{{.Server.Version}}'
docker compose version --short

Debian and Ubuntu:

curl -fsSL https://get.docker.com | sudo sh

Fedora:

sudo curl -fsSL https://download.docker.com/linux/fedora/docker-ce.repo -o /etc/yum.repos.d/docker-ce.repo
sudo dnf install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

RHEL, Rocky and Alma (get.docker.com does not support Rocky and Alma):

sudo curl -fsSL https://download.docker.com/linux/centos/docker-ce.repo -o /etc/yum.repos.d/docker-ce.repo
sudo dnf install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

If dnf shows a conflict with podman, buildah or runc, remove these packages first. Or use native mode.

Arch:

sudo pacman -S --needed docker docker-compose docker-buildx

Start Docker:

sudo systemctl enable --now docker

4. Firewall

Open only SSH, HTTP and HTTPS. With ufw:

sudo ufw allow OpenSSH
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw --force enable

Allow SSH before you turn ufw on. Else you lose the connection.

With firewalld:

sudo firewall-cmd --permanent --add-service=http --add-service=https
sudo firewall-cmd --add-service=http --add-service=https

With a Cloudflare Tunnel, do not open 80 and 443.

5. Swap

If the server has less than 4 GB of RAM and no swap, add swap:

sudo fallocate -l 3G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab

On btrfs, use sudo btrfs filesystem mkswapfile --size 3g /swapfile in place of the first three commands.

6. Get the code

sudo mkdir -p /var/www
cd /var/www
sudo git clone https://github.com/zerodot-io/zerodot.git zerodot
cd zerodot

7. Settings

Make .env and set new random secrets:

sudo cp .env.example .env
sudo sed -i "s|^ZERODOT_SECRET_KEY=.*|ZERODOT_SECRET_KEY=$(openssl rand -base64 32)|" .env
sudo sed -i "s|^BETTER_AUTH_SECRET=.*|BETTER_AUTH_SECRET=$(openssl rand -base64 32)|" .env
sudo sed -i "s|^ZERODOT_BASE_URL=.*|ZERODOT_BASE_URL=https://zerodot.example.com|" .env
sudo sed -i "s|^ZERODOT_TRUST_PROXY=.*|ZERODOT_TRUST_PROXY=true|" .env
sudo sed -i "s|^ZERODOT_BLOB_DIR=.*|ZERODOT_BLOB_DIR=/blobs|" .env
sudo sed -i "s|^ZERODOT_DB_PASSWORD=.*|ZERODOT_DB_PASSWORD=$(openssl rand -hex 24)|" .env
sudo sed -i "s|^ZERODOT_VALKEY_PASSWORD=.*|ZERODOT_VALKEY_PASSWORD=$(openssl rand -hex 24)|" .env
sudo chmod 600 .env
Setting What it does
ZERODOT_SECRET_KEY Encrypts the saved credentials.
BETTER_AUTH_SECRET Signs the sign-in sessions.
ZERODOT_BASE_URL The public address. Links and OAuth2 callbacks use it.
ZERODOT_TRUST_PROXY Read the client address from X-Forwarded-For.
ZERODOT_BLOB_DIR Keep files and large node outputs on disk, in the volume blob-data.
ZERODOT_DB_PASSWORD The password of the Postgres container.
ZERODOT_VALKEY_PASSWORD The password of the Valkey container.

Make a copy of ZERODOT_SECRET_KEY. Keep it in a safe place. If you lose it, nobody can open the saved credentials.

Postgres reads ZERODOT_DB_PASSWORD only at the first start. Set it before the first docker compose up.

8. Bind the app to localhost

The compose file publishes port 3000 on all addresses. Docker skips ufw for published ports. Thus port 3000 would be open to the internet over plain HTTP. Bind it to localhost:

sudo tee docker-compose.override.yml >/dev/null <<'CONF'
services:
  proxy:
    ports: !override
      - "127.0.0.1:3000:3000"
CONF

If port 3000 is in use on the server, change the left part (for example 127.0.0.1:3100:3000). Use the same port in the proxy.

On Fedora and RHEL with SELinux enforcing, the Caddy container cannot read the mounted Caddyfile. Add the z label:

sudo tee docker-compose.override.yml >/dev/null <<'CONF'
services:
  proxy:
    ports: !override
      - "127.0.0.1:3000:3000"
    volumes: !override
      - ./Caddyfile:/etc/caddy/Caddyfile:ro,z
CONF

9. Pull and start

sudo docker compose pull
sudo docker compose up -d
sudo docker compose ps
curl -sI http://127.0.0.1:3000/

The images come from GHCR. The first pull takes about 1 minute. All services must show Up. The curl command must show 307 with Location: /sign-in.

To build on the server, run sudo docker compose up -d --build. The first build takes about 10 minutes and needs 4 GB of RAM.

All services restart after a crash or a reboot (restart: unless-stopped).

10. Proxy

Set up one proxy:

11. First sign-in

  1. Open https://zerodot.example.com and sign up. The first user is the instance admin.
  2. Open System > Instance and turn Public signup off. People that you invite can still join.

To lock signup off, set ZERODOT_SIGNUP_DISABLED=true in .env. Then run sudo docker compose up -d.

Update

cd /var/www/zerodot
sudo git pull
sudo docker compose pull
sudo docker compose up -d

Change the database password

An install from before ZERODOT_DB_PASSWORD has the password zerodot. To change it:

cd /var/www/zerodot
NEW=$(openssl rand -hex 24)
sudo docker compose exec postgres psql -U zerodot -c "alter user zerodot with password '$NEW'"
sudo sed -i "s|^ZERODOT_DB_PASSWORD=.*|ZERODOT_DB_PASSWORD=$NEW|" .env
sudo grep -q '^ZERODOT_DB_PASSWORD=' .env || echo "ZERODOT_DB_PASSWORD=$NEW" | sudo tee -a .env
sudo docker compose up -d

To give Valkey a password, set ZERODOT_VALKEY_PASSWORD in .env. Then run sudo docker compose up -d.

Scale

Setting in .env What it does
WORKER_REPLICAS The number of worker containers.
ZERODOT_WORKER_CONCURRENCY The number of runs in each worker at the same time.
SANDBOX_REPLICAS The number of code sandbox containers.
ZERODOT_DB_MAX_CONNECTIONS max_connections of the Postgres container.

Each worker uses about 30 database connections. Raise ZERODOT_DB_MAX_CONNECTIONS when you add workers.

Notes

  • Postgres and Valkey publish no ports.
  • The sandbox container has no network to the outside, no volumes, a read-only file system and 512 MB of memory.
  • Keep ZERODOT_ENABLE_EXECUTE_COMMAND=false unless you trust all users who can edit workflows.

Change this page on GitHub