The install script sets up Zerodot on a Linux server with HTTPS. It asks what it needs to know. For the server that you need, see Requirements.
A Linux server is the recommended place for production. To run Zerodot on your own computer, or for a small self-host on a Mac or a Windows PC, see Install on macOS or Windows.
Quick install
Point the DNS record of your domain to the server:
A zerodot.example.com <server IPv4 address>Connect to the server as
root, or as a user that can usesudo.Download the script:
curl -fsSL https://zerodot.io/install.sh -o install.shRun the script:
sudo bash install.sh zerodot.example.comPick Recommended or Advanced. With Recommended, you give only the address, and the script picks the rest. See Recommended or Advanced.
Read the plan that the script shows, and accept it. The script changes nothing before you accept the plan.
Open
https://zerodot.example.comand sign up. The first user is the instance admin.Open System > Instance and turn Public signup off. People that you invite can still join.
To start with signup off, give the admin email:
sudo bash install.sh zerodot.example.com --admin-email me@example.com --disable-signup
Only the admin emails and invited people can sign up. For more options (port, version, backups, automatic updates), see Customize the install.
Make a copy of ZERODOT_SECRET_KEY from the .env file in the install folder (default /var/www/zerodot/.env). Keep the copy in a safe place. This key encrypts the saved credentials. If you lose it, nobody can open them.
Read the script before you run it as root. It is on GitHub.
Check the server first
To see what the script would do, run it with --check. It changes nothing and does not need root:
bash install.sh --check
The script prints a list. Each line starts with ✔ (good), ! (warning) or ✘ (problem). It checks these items:
- The operating system, the package manager (apt, dnf or pacman), the CPU type, systemd and SELinux.
- Access to
github.comandghcr.io. - RAM, swap and free disk space on
/var. - The program on ports 80 and 443.
- Docker and Docker Compose (2.24 or newer). The script also finds Podman that acts as Docker.
- Postgres on the server, and its version (13 or newer can be shared).
- Valkey or Redis on the server, its version and its
maxmemory-policy. - Caddy, nginx, cloudflared and the firewall.
At the end, it shows the recommended mode, the proxy that it would use, and tips. If it finds a problem (✘), it exits with status 1.
Recommended or Advanced
A new install starts with one question:
- Recommended (the default): you give the address. The script picks the rest: the mode for this server, the name, the proxy, Postgres and Valkey, the extras and the port. Then it shows the plan. It changes nothing before you accept the plan.
- Advanced: the script asks about each choice. Then it asks for the port, the admin emails, signup, the version, backups and automatic updates.
--recommended or --advanced skips the question. --yes uses Recommended. In both setups, the options that you give on the command line win. For example, this command uses Recommended, but with nginx:
sudo bash install.sh zerodot.example.com --recommended --proxy nginx
Questions and answers
For a new instance, the script asks these questions, in this order. With Recommended, it asks only steps 1, 2 and 10.
| Step | Question | Flag that skips it |
|---|---|---|
| 1 | Setup: Recommended or Advanced | --recommended, --advanced, --yes |
| 2 | Address: domain, sslip.io or server IP | <domain>, --no-domain, --ip |
| 3 | Name of the instance | --name |
| 4 | Mode: Docker or native | --docker, --native |
| 5 | Proxy | --proxy |
| 6 | Where Postgres runs | --postgres, DATABASE_URL |
| 7 | Where Valkey runs | --valkey, VALKEY_URL |
| 8 | Extras (a checklist) | --swap, --firewall, --certbot and their --no- forms |
| 9 | Port, admin emails, signup, version, backups, automatic updates | The options in Customize the install |
| 10 | The plan: start or stop | --yes |
The menus show only the choices that fit the server. For example, the Postgres menu shows "Postgres on this server" only when the script finds Postgres 13 or newer. If you pick "Another Postgres", the script asks for the URL. See Databases.
The Extras checklist shows only the items that apply:
- Swap: only when RAM is less than 4 GB and there is no swap.
- Firewall: open ports 80 and 443. Only when ufw or firewalld is on and the proxy is Caddy or nginx.
- certbot: only for nginx with HTTPS.
All three are on by default.
Advanced setup asks for the port, the admin emails, signup, the version, backups and automatic updates. To give these values without questions, see Customize the install.
On a terminal, the script asks its questions in dialog screens (menus and input boxes). It uses whiptail for these screens. If whiptail is not installed, it asks plain questions.
| Option | How the script asks |
|---|---|
| (none) | Dialog screens. |
--no-tui |
Plain questions in the terminal. |
--yes |
No questions. It uses Recommended and the default answer for each question. |
Without a terminal (for example in a CI job), the script also uses the default answers.
With --yes, give the address: a domain, --no-domain or --ip. Else the script stops. To use "Another Postgres" or "Another Valkey", set DATABASE_URL or VALKEY_URL.
With --yes, the script does not change a service that other apps can share. It stops before that change. To let it make the change, add --allow-host-changes. See What the installer does not change.
Example of a run without questions:
sudo bash install.sh zerodot.example.com --docker --proxy caddy --yes
Choose the mode
The script asks which mode to use and recommends one. To skip the question, give the mode:
sudo bash install.sh zerodot.example.com --docker
sudo bash install.sh zerodot.example.com --native
For the differences, see Docker mode or native mode.
What Docker mode does
- It installs Docker if Docker is missing.
- It clones the code to
/var/www/zerodot. - It writes
.envwith new random secrets and passwords. - It writes
docker-compose.override.yml. This file binds the app to127.0.0.1:3000(or the next free port). - It pulls the images from GHCR. If the pull fails, it builds the images on the server.
- It starts the containers and waits for the app to answer.
- It sets up the proxy.
What native mode does
- It installs the build tools (Python 3, make, a C++ compiler). The code sandbox has a native module.
- It finds Node 22 or newer. If there is none, or if Node is in a home folder, it puts a private Node in
/opt/zerodot-node. - It installs the exact pnpm version of the code in
/opt/zerodot-tools. - It uses Postgres and Valkey on the server, or installs them. It makes a new database, user and Valkey database number for Zerodot.
- It builds the code (about 10 minutes).
- It adds a system user and four systemd services:
zerodot-web,zerodot-api,zerodot-workerandzerodot-sandbox. - It sets up the proxy.
In native mode, all services listen on 127.0.0.1 only. The sandbox runs code from users. It must never be reachable from the internet.
Choose the proxy
The proxy serves HTTPS. The script asks which proxy to use. To skip the question, use --proxy:
--proxy |
What the script does | Guide |
|---|---|---|
caddy |
Installs Caddy if it is missing. Adds a site. Caddy gets the certificate. | Caddy |
nginx |
Installs nginx if it is missing. Adds a site. Gets a certificate with certbot. | nginx |
cloudflared |
Connects a Cloudflare Tunnel. Opens no ports. | Cloudflare Tunnel |
none |
Changes no proxy. Prints the upstream address and an example. Same as --no-proxy. |
Other proxies |
Without --proxy, the default is the proxy that has ports 80 and 443 now. If both ports are free, the default is Caddy. If another program has the ports, the default is none.
If you ask for Caddy or nginx and another program has the ports, the script stops.
Update
Run zerodot update (or sudo zerodot update; see zerodot CLI):
zerodot update
Or run the script again:
sudo bash /var/www/zerodot/scripts/install.sh zerodot.example.com
The script finds the install with this domain and updates it. It pulls the new code and the new images (or builds again in native mode), then restarts the services. It keeps .env, the secrets and the database.
When the script finds an install and you give no domain, it asks:
- Update an install that exists.
- Set up another instance.
- Uninstall an install. See Uninstall.
To skip the question, add --update. If the server has more than one install, also give the domain.
An update keeps the choices of the first run: mode, address, proxy, and the place of Postgres and Valkey. The script reads them from .zerodot-install in the install folder. The options that you do not give again (for example --port, --version or --backup) also keep their value.
The script finds installs in /var/www, /opt, /srv, the home folder of root, and the folders of Docker Compose projects. A folder counts as an install only when it has .env or .zerodot-install. A clone of the code for development does not count.
An update stops if the install folder has no .env. A new .env would have new keys, and the saved credentials could not be opened with them. Put back the old .env from a backup, then run again.
Pin a version
By default, the script installs the newest release. To install one release, give --version:
sudo bash install.sh zerodot.example.com --version 0.2.25
The script uses the git tag and the image tag of that release. Updates stay on it until you give another version. To follow the newest release again, give --version latest.
For an image mirror, add --image REPO, for example --image registry.example.com/zerodot.
Automatic updates and backups
sudo bash install.sh zerodot.example.com --backup daily --auto-update weekly
--backup daily|weekly|offbacks up the database and.envat about 03:00.--auto-update daily|weekly|offruns the script with--update --yesat about 04:00. A pinned--versionstays.
Linux uses systemd timers. macOS uses launchd. For the backup folder and other details, see Backups and automatic updates.
Uninstall
Run zerodot uninstall (see zerodot CLI), or run the script and pick Uninstall an install:
zerodot uninstall
sudo bash install.sh zerodot.example.com --uninstall
With more than one install on the server, the script lists them and you pick one. There is no default. With --yes, give the domain of the install. The script removes only that instance. The other instances do not change.
The script asks what to remove. Then you type the name of the instance to continue.
- The services only (the default): the script stops and removes the services (or the containers) and the timers. It keeps the folder,
.env, the database, the files and the proxy site, so you can install again later. It prints the commands that remove the rest. - Everything (
--purge): the script also removes the Docker volumes, the Postgres database and user that it made,/var/lib/NAME, the system user, the--data-dirfolder, the nginx site that it wrote, and the install folder. You cannot undo this. A copy of.envstays in your home folder, asNAME.env.removed-DATE.
sudo bash install.sh zerodot.example.com --uninstall --purge
These items always stay: a database that you gave with DATABASE_URL, the keys in a Valkey outside Docker, the Caddy block (remove it by hand), the public hostname in Cloudflare, and the backups.
More than one instance
One server can run more than one instance. Each instance has its own name, folder, domain, ports, database and services.
sudo bash install.sh staging.example.com --new --name zerodot-staging
--newskips the question "update or new".--namesets the name. The script uses it for the folder (/var/www/zerodot-staging), the services and the database (zerodot_staging).- Without
--name, the script useszerodotfor the first instance. For the next ones, it useszerodot-<first part of the domain>. - The script picks free ports for each instance.
A name has lower-case letters, digits and -. It starts with a letter. It has 31 characters or fewer.
After the install
The script shows the commands that you need:
| Task | Docker mode | Native mode |
|---|---|---|
| Logs | cd /var/www/zerodot && docker compose logs -f |
journalctl -u zerodot-api -f |
| Restart | cd /var/www/zerodot && docker compose restart |
systemctl restart zerodot-web zerodot-api zerodot-worker zerodot-sandbox |
| Back up | See Back up and move | See Back up and move |
In either mode, use zerodot status, zerodot logs, zerodot restart, zerodot backup, or zerodot doctor. See zerodot CLI.
All containers restart after a crash or a reboot (restart: unless-stopped). All native services restart after a crash (Restart=always) and start at boot.
The script writes each change to /var/log/zerodot-install.log (macOS: ~/Library/Logs/zerodot-install.log).
For all options and environment variables, see Installer options.