Skip to main content
Use this page to run Sediment for a team on one Amazon Elastic Compute Cloud (EC2) instance with one public hostname. The Sediment API runs under systemd from the published package. Docker Compose runs PostgreSQL and the Traefik proxy, which serves HTTPS. You don’t need a Sediment checkout or an image build. If you already run PostgreSQL and HTTPS, follow Deploy Sediment on your own host instead.

Prepare the instance

  1. Launch an Ubuntu 24.04 instance on 64-bit Intel, AMD, or Arm hardware. Give it at least 4 virtual CPUs (vCPUs), 8 GB of memory, and encrypted persistent storage for the database, credentials, mirrors, and backups.
  2. Sign in over SSH as a dedicated non-root operator account that has sudo access. Run the remaining commands on this page from that session.
  3. Install curl, OpenSSL, and Docker Engine with its Compose plugin. For Docker, follow Install Docker Engine on Ubuntu.
  4. To run Docker as a non-root user, follow Linux post-installation steps for Docker Engine, and then sign in again. Docker access gives this account root-level control of the host.
  5. Run docker info and docker compose version without sudo. Both commands succeed.
  6. Associate an Elastic IP address with the instance.
  7. Point your hostname’s DNS A record at the Elastic IP address. If you also publish an AAAA record, make the host reachable over IPv6.
  8. Configure the instance security group and the host firewall:
    • Allow inbound TCP ports 80 and 443. Certificate renewal requires inbound port 80 and outbound access to the certificate authority.
    • Restrict SSH to the operator’s IP address.
    • Keep ports 5432 and 8000 private.

Install Sediment

  1. Select a published release. Optional: check it with Verify a release.
  2. As the operator account, run the installer. This example installs version 0.3.0:
    The output shows the version that you selected.
The installer also installs Python 3.12 and the host libraries. UV_NO_BUILD=1 makes the installation fail instead of building a missing wheel from source.

Configure PostgreSQL and Traefik

  1. Create a private deployment directory and its environment files. Before you run the following commands, replace the example hostname, certificate contact email, and organization. The commands stop if the directory already exists.
    Keep .env, server.env, and certificates/ private. Don’t source these files or share them with developers.
  2. Save the following as compose.yaml in ~/sediment-deploy:
  3. Save the following as routes.yml beside compose.yaml:
  4. Make the routing file readable by the proxy, and then start the database:
    PostgreSQL reports healthy. If it doesn’t, inspect docker compose logs --tail 100 postgres before you continue.
Host networking lets Traefik reach the API on loopback. The Traefik container runs as root with only the capability to bind ports 80 and 443. It gets no Docker socket, database password, or Sediment credential. Sediment’s release scans don’t cover the upstream PostgreSQL and Traefik images, so track their releases yourself.

Run Sediment as a service

  1. Create the systemd user directory: mkdir -p ~/.config/systemd/user.
  2. Save the following unit as ~/.config/systemd/user/sediment.service:
  3. Enable startup at boot and after logout, and then start Sediment:
    The health response shows "status":"ok" and the version that you selected. If startup fails, inspect journalctl --user -u sediment.service -n 100 --no-pager.
On start, Sediment creates separate database roles and applies migrations. The API runs with the runtime role only. Sediment writes its generated API tokens and database-role passwords to ~/.sediment/server/server.env, and its Git mirrors to ~/.sediment/server/mirror.

Enable and verify HTTPS

  • From ~/sediment-deploy, start Traefik and check the public endpoint:
    The health response matches the local check. Don’t bypass certificate verification.
Traefik obtains and renews the certificate and redirects HTTP to HTTPS. If certificate issuance fails, check public DNS, ports 80 and 443, and the proxy log. After you correct DNS, run docker compose restart proxy and repeat the public health check. The request limit applies to each client address: an average of 100 requests per second, with bursts of 200. Clients behind one outbound address share that limit.

Set up an operator shell

Reports, Derivations, exports, and quarantine commands read PostgreSQL directly through the sediment_operator role.
  1. In your SSH session, set the following variables. Set SEDIMENT_ORG_ID to the value in ~/sediment-deploy/server.env:
  2. Check the schema:
    The output shows at_head.
  3. Sign in to the API with the operator token:
    On loopback, sediment login reads the operator token from ~/.sediment/server/server.env. sediment facts prints zero counts until the first capture arrives.

Manage the services

Where another page tells you to stop, start, restart, or inspect Sediment, use these commands: Stop the API before you stop the database. Warning: docker compose down --volumes permanently deletes the database. To upgrade Sediment, follow Maintain a deployment, and rerun the installer command from Install Sediment with the target version. To upgrade PostgreSQL or Traefik, follow its own release notes. Don’t change the PostgreSQL major version on an existing volume.

Next steps

  1. Enroll your team with https://sediment.example.com as the endpoint.
  2. A single instance is a single point of failure. Before you rely on the data, set up backups of the postgres-data volume, ~/sediment-deploy, and ~/.sediment/server.