This guide walks you through deploying the SafeBox server on a fresh Ubuntu 24.04 VPS using Docker. You'll configure the server, clone the repo, and run the application in a clean, production-ready way.
Here is an example of a server using SafeBox server:
https://anttp.antsnest.site/gindex
https://github.com/SafeMedia/autonomi-chrome-extension
https://github.com/SafeMedia/safebox-client
- A VPS or cloud instance (Ubuntu 24.04 recommended)
- A domain pointing to your server's IP
- Basic familiarity with the terminal
sudo apt update && sudo apt upgrade -yInstall required packages:
sudo apt install apt-transport-https ca-certificates curl software-properties-common -yAdd Docker’s GPG key:
sudo mkdir -m 0755 -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo tee /etc/apt/keyrings/docker.asc > /dev/nullAdd the Docker repository:
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] \
https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/nullInstall Docker and related tools:
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -yVerify Docker installation:
docker --versionEnable the Docker service:
sudo service docker start
⚠️ If you're using SSH, allow it before enabling the firewall!
sudo ufw allow ssh
sudo ufw allow http
sudo ufw allow https
sudo ufw enableCreate a directory for the code:
sudo mkdir -p /home/git/safebox-server-
Go to: SafeMedia/safebox-server
-
Click Fork to create your own copy
-
Edit the
Caddyfilein your forked repo:- Change
ws.mydomain.com {to your actual domain, do the same for ws. anttp. & dweb.:ws.example.com {anttp.example.com {dweb.example.com {
- Change
-
Clone your forked repo:
git clone https://github.com/your-username/safebox-server.git /home/git/safebox-server
git clone https://github.com/SafeMedia/safebox-server.git /home/git/safebox-server
cd /home/git/safebox-server
nano CaddyfileReplace the first part of the file with your actual domain.
Ensure your domain/subdomains point to your server's IP via A records.
| Type | Host | Value (IP) | TTL |
|---|---|---|---|
| A | ws | your-server-ip | 5 min |
| A | anttp | your-server-ip | 5 min |
| A | dweb | your-server-ip | 5 min |
DNS changes may take time to propagate.
docker compose -f /home/git/safebox-server/docker-compose.yml up -dTo rebuild the app with fresh changes:
docker compose -f /home/git/safebox-server/docker-compose.yml up --build -dTo stop the app:
docker compose -f /home/git/safebox-server/docker-compose.yml downWebSocket Test (via Postman):
-
Open a new WebSocket request.
-
Connect to:
wss://ws.yourdomain.com -
You should see:
Connected to wss://ws.yourdomain.com -
Send a message like:
91d16e58e9164bccd29a8fd8d25218a61d8253b51c26119791b2633ff4f6b309/start-a-node.pngExpect a binary response starting with:
...v{"mimeType":"image/png","xorname":"91d16e58e...
Try accessing:
https://anttp.yourdomain.com/91d16e58e9164bccd29a8fd8d25218a61d8253b51c26119791b2633ff4f6b309/autonomi/start-a-node.png
List all running Docker containers:
docker psView logs for a container:
docker container logs <container-id>Delete current source code (if needed to restart):
sudo rm -rf /home/git/safebox-serverYou can pull the latest again:
git clone https://github.com/username/safebox-server.git /home/git/safebox-serverIf you wish to upgrade & rebuild your images in the future you can do:
docker compose -f /home/git/safebox-server/docker-compose.yml downthen
docker compose -f /home/git/safebox-server/docker-compose.yml up --build -dIf it does not update you can do a hard reset.
warning - only do so if you are only running safebox server.
If you are running other services via docker, then you will need to manually kill the individual safebox processes.
delete all docker images (warning)
docker kill $(docker ps -q)Remove all docker images (warning)
docker rmi -f $(docker images -aq)Prune all docker volumes (warning)
docker system prune -a --volumes -fYour SafeBox server should now be up and running, accessible via your sub-domains and ready to serve content securely and efficiently.
Make/find an issue & create a PR - All contributions appreciated!