Follow these steps to install Ozone using Docker on Ubuntu:
1. Open Linux Firewall
If using ufw, allow HTTP and HTTPS traffic:
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
2. Install Docker
Uninstall old versions, set up the repository, and install Docker Engine and Docker Compose plugin as per the official Docker instructions for Ubuntu.
3. Set up Directories
Create the necessary directory structure for Ozone and its dependencies:
sudo mkdir /ozone
sudo mkdir /ozone/postgres
sudo mkdir --parents /ozone/caddy/data
sudo mkdir --parents /ozone/caddy/etc/caddy
4. Configure Caddy
Create a Caddyfile to handle TLS and reverse proxying. Replace ozone.example.com with your domain and ozone@example.com with your email.
cat <<CADDYFILE | sudo tee /ozone/caddy/etc/caddy/Caddyfile
ozone.example.com {
tls ozone@example.com
reverse_proxy http://localhost:3000
}
CADDYFILE
5. Configure Postgres and Ozone Environment Variables
Create /ozone/postgres.env with your POSTGRES_USER, POSTGRES_PASSWORD, and POSTGRES_DB.
Then, create /ozone/ozone.env. You must provide values for:
OZONE_HOSTNAMEOZONE_SERVICE_ACCOUNT_HANDLEOZONE_SERVER_DID (resolved via atproto identity API)OZONE_ADMIN_PASSWORDOZONE_SIGNING_KEY_HEX (a secp256k1 private key in hex format)OZONE_DB_POSTGRES_URL (using the credentials from your postgres.env)
6. Deploy with Docker Compose and Systemd
Download the compose.yaml file and create a systemd service to manage the containers.
# Download compose file
curl https://raw.githubusercontent.com/bluesky-social/ozone/main/service/compose.yaml | sudo tee /ozone/compose.yaml
# Create systemd service
cat <<SYSTEMD_UNIT_FILE | sudo tee /etc/systemd/system/ozone.service
[Unit]
Description=Bluesky Ozone Service
Documentation=https://github.com/bluesky-social/ozone
Requires=docker.service
After=docker.service
[Service]
Type=oneshot
RemainAfterExit=yes
WorkingDirectory=/ozone
ExecStart=/usr/bin/docker compose --file /ozone/compose.yaml --profile daemon up --detach
ExecStop=/usr/bin/docker compose --file /ozone/compose.yaml --profile daemon down
[Install]
WantedBy=default.target
SYSTEMD_UNIT_FILE
# Start service
sudo systemctl daemon-reload
sudo systemctl enable ozone
sudo systemctl start ozone