imbox runs on one small server that you control. There are four ways to put it there. Pick one, follow its steps, then go on to First run.
| Way | Best for | Takes | You need |
|---|---|---|---|
| One-line installer | A fresh Linux server, and the quickest start. Docker, HTTPS and nightly backups, set up for you. | About 5 minutes | Debian or Ubuntu with root access (a domain is optional) |
| Server script | A fresh Linux server. The most complete setup: HTTPS, firewall, nightly backups. | About 15 minutes | Debian or Ubuntu, root access, a domain |
| Docker Compose | A machine that already runs Docker. | About 10 minutes | Docker, a reverse proxy for HTTPS |
| Railway | No server to look after. | About 10 minutes | A Railway account |
If you are not sure, use the one-line installer.
Before you start
All four ways need the same few things.
- A domain name. imbox needs its own address, such as
imbox.example.com. Add a DNSArecord that points it at your server's public IP address. - Ports 80 and 443 open on the server, so it can get a certificate and serve the site.
- A size that fits. One CPU and 2 GB of memory is the minimum. Two CPUs and 4 GB is comfortable. Allow 20 GB of disk.
- A place to keep two secrets. The install creates a
SESSION_SECRETand a database password. Copy theSESSION_SECRETsomewhere safe. It encrypts your saved mailbox passwords, AI keys and two-factor secrets, and without it they can't be read again.
Check that the domain already reaches your server before you go on. The certificate step fails if it doesn't.
dig +short imbox.example.comThe answer should be your server's IP address.
One-line installer
This is for a Debian or Ubuntu server on x86_64. Run it once, as root, on the server:
curl -fsSL https://imbox.lol/install.sh | sudo bashIt checks the server, installs Docker if it is missing, and starts imbox, its PostgreSQL database and Caddy (automatic HTTPS) as one Docker Compose stack in /opt/imbox. It generates the secrets once, sets up a nightly database backup (14 days kept), and waits until imbox answers a health check. Then it prints the address to open. The first visit asks you to create the owner account. Carry on with First run.
With no domain it uses <your-ip>.sslip.io, a free name that points at your server and gets a real certificate, so you can try imbox before you set up DNS. For your own domain, point its DNS A record at the server first, then put the domain after sudo:
curl -fsSL https://imbox.lol/install.sh | sudo IMBOX_DOMAIN=imbox.example.com bashTo update, run the same command again. It keeps your settings and secrets, pulls the newest image and restarts what changed.
| Setting | What it does |
|---|---|
IMBOX_DOMAIN | The address imbox answers on. Default: <your-ip>.sslip.io. |
IMBOX_DIR | Where the files live. Default /opt/imbox. |
IMBOX_VERSION | latest, or a version tag. Default latest. |
IMBOX_NO_CRON | Set to 1 to skip the nightly backup. |
IMBOX_DRY_RUN | Set to 1 to check the server and print the plan, changing nothing. |
Keep a copy of SESSION_SECRET from /opt/imbox/.env. Without it, stored mailbox passwords and keys cannot be read after a restore. The script reads like a short shell program; open https://imbox.lol/install.sh first if you want to see what it does before you run it.
Server script
This is for Debian 12 or 13, or Ubuntu 22.04 or 24.04, on x86_64 or arm64. You run it once, as root, on a fresh machine.
1. Run the setup
sudo apt-get update && sudo apt-get install -y git
git clone https://github.com/fr3on/imbox.git
sudo IMBOX_DOMAIN=imbox.example.com bash imbox/deploy/setup.shReplace imbox.example.com with your own domain. The script:
- Installs Node.js 22, PostgreSQL (the version your system ships, 14 or newer works), and Caddy.
- Creates a
imboxsystem user, a database, and a generated database password. - Writes
/etc/imbox/imbox.envwith a newSESSION_SECRETand your address asAPP_URL. - Sets up the systemd service, Caddy with automatic HTTPS, and a nightly backup.
- Opens only SSH, HTTP and HTTPS in the firewall.
It does not put the app on the server yet. That is the next step.
2. Put the app on the server
Choose the way that suits you. Both end with the same message.
From your computer. This is also how you update later. You need the repository on your computer and an SSH key for the server.
First let your server user switch releases without a password prompt. On the server:
echo 'YOUR_USER ALL=(root) NOPASSWD: /usr/local/bin/imbox-activate' | sudo tee /etc/sudoers.d/imbox-deployThen, on your computer:
git clone https://github.com/fr3on/imbox.git && cd imbox
bash deploy/deploy.sh [email protected] ~/.ssh/your-keyOn the server, from a release. Download imbox-VERSION.tgz and SHA256SUMS from the releases page, check the file, and switch to it:
sha256sum --check --ignore-missing SHA256SUMS
sudo imbox-activate imbox-VERSION.tgz VERSIONEither way you should see:
Release VERSION is live.If the new release does not answer a health check within about a minute, the script puts the previous one back and prints the service log. See Troubleshooting.
3. Check it
On the server:
curl -s http://127.0.0.1:8787/healthzYou should get {"ok":true}. Then open https://imbox.example.com in a browser. It sends you to a sign-up page, where you make the owner account. Carry on with First run.
After the install
- Run
sudo bash imbox/deploy/harden.shfor key-only SSH, fail2ban and automatic security updates. - Read Self-hosting for backups, restore and running several processes.
- Your settings live in
/etc/imbox/imbox.env. See Configuration.
Docker Compose
This runs imbox and its database in containers. The container listens on 127.0.0.1:8787 only, so you put a reverse proxy in front of it for HTTPS.
1. Get the files and set three values
git clone https://github.com/fr3on/imbox.git && cd imbox
cp .env.example .envOpen .env and set:
| Setting | What to put |
|---|---|
POSTGRES_PASSWORD | A long random password for the database. |
APP_URL | Your address with https://, for example https://imbox.example.com. It must match the address you open in the browser. |
SESSION_SECRET | The output of openssl rand -hex 32. Keep a copy somewhere safe. |
Compose stops with a message naming the setting if one of these is empty.
2. Start it
docker compose up -dThe compose file pulls the published image. If your copy of the repository has no published image yet, build it yourself: in docker-compose.yml, comment out the image: line and uncomment build: ., then run docker compose up -d --build.
3. Add HTTPS
Any reverse proxy works. With Caddy, which gets certificates on its own, the whole file is:
imbox.example.com {
reverse_proxy 127.0.0.1:8787 {
flush_interval -1
}
}The flush_interval line makes live updates reach the browser as they happen.
4. Check it
docker compose ps
curl -s http://127.0.0.1:8787/healthzBoth containers should be running, and the second command should print {"ok":true}. Open your address and carry on with First run. If something is wrong, docker compose logs -f imbox shows why.
To update later, run docker compose pull && docker compose up -d. See Updating.
Railway
Railway runs it for you, with no server to look after. See the Railway guide.
Where to go next
- First run: make the owner account, turn on two-factor sign-in, connect your first mailbox.
- Troubleshooting: if the site doesn't open or something misbehaves.
- Configuration: every setting, and what changes when you change it.