Skip to main content
Earnie installs the same way on any cloud: one Linux virtual machine with Docker, set up as in Installing Earnie. This page tells you which services to pick on AWS, Google Cloud, Azure, and DigitalOcean, and what to watch for on each.
This page is guidance, not a tested recipe. SCANOSS runs Earnie on its own virtual machines, not on these four providers. Machine names and features change, so check them in your provider’s console, and for your region, before you build.

The Simplest Setup

For most organisations, this is enough:
  1. One virtual machine on x86-64, running Ubuntu 24.04 LTS. See Choose a Machine.
  2. A separate SSD data disk for Earnie’s data directory. See Disk.
  3. A static public IP address attached to the machine, so the address survives a restart.
  4. A DNS record that points your Earnie name, such as earnie.example.com, at that address.
  5. Firewall rules that allow ports 443 and 80 in, and allow outbound traffic. See Network.
  6. Let’s Encrypt for the certificate, which is Earnie’s default.
Earnie then runs its PostgreSQL database as a container on the same machine. Add a managed PostgreSQL service or a load balancer only when you need them. When the machine, disk, and network are ready, install Earnie on it as described in Installing Earnie.

Choose a Machine

Earnie’s server images are built for x86-64 only. Don’t choose an ARM machine, such as AWS Graviton, Google Axion or Tau T2A, Azure Cobalt or Ampere, because Earnie won’t start on it. Pick a machine with dedicated CPU, not a burstable or shared one. Cryptography scans keep every core busy for minutes, and a burstable machine slows down once it runs out of CPU credits. These machines match the recommended sizes in Self-hosting requirements. They are examples. Any machine with at least the same CPU and memory works. If you run PostgreSQL as a container on the same machine, add the database’s CPU and memory from Database.

Disk

Put Earnie’s data directory, /var/lib/earnie by default, on SSD storage of the size in Disk. A separate data disk, rather than the boot disk, makes it easier to resize, snapshot, and move to a new machine.

Network

Each provider has its own name for the static address, the firewall, and the gateway that gives a machine without a public address outbound access: Allow these in:
  • Port 443 from your users, your CI runners, and your GitHub or GitLab server.
  • Port 80 from the internet if you use Let’s Encrypt, because it checks your name over port 80. With your own certificate, port 80 only redirects to HTTPS, and you can limit it like port 443.
Allow outbound traffic on ports 80 and 443 to the destinations in Outbound, and to your private registry mirrors on their own ports if you use them. Most providers allow all outbound traffic by default. If the machine sits in a private subnet without a public address, for example behind a load balancer, it needs a NAT gateway to reach them. On Azure, check that the subnet has outbound access at all: newer virtual networks can have private subnets that have none until you add a NAT gateway. Keep SSH closed to the internet. Use your provider’s console access, such as AWS Systems Manager Session Manager, Google Cloud IAP, or Azure Bastion, or allow SSH only from your own network.

Use a Managed PostgreSQL Service

You can run PostgreSQL as a container on the Earnie machine, or use your provider’s managed service. A managed service handles backups, patches, and high availability for you. When you create the service:
  • Use PostgreSQL 16. Earnie needs no extensions.
  • Put the database in the same region as the Earnie machine, and connect over the private network. Don’t give the database a public address.
  • Check the connection limit. The Earnie API and each scanner worker open up to 25 connections each, set by DB_MAX_CONNS in tenant.env. With both the cryptography and AI provenance workers, that’s up to 75. The smallest plans of some services allow fewer. Pick a plan that allows more, or lower DB_MAX_CONNS.
  • Plan to connect directly, not through a connection pooler in transaction mode, such as PgBouncer or a provider’s connection pool. Earnie holds database locks across statements, which transaction pooling breaks.
Then set it up for Earnie:
  1. Create a user and a database that it owns. Earnie creates its own schemas and tables when it starts, so its user needs to create objects in the database. Connected as the service’s administrator, run:
    The GRANT line is needed because the administrator of a managed service isn’t a superuser. On PostgreSQL 16 it can make another role the owner of a database only if it’s a member of that role. Without it, CREATE DATABASE fails with must be able to SET ROLE "earnie". If your organisation doesn’t allow a separate owner, create the database without one, then connect to the earnie database and grant the rights Earnie needs instead:
  2. Give the installer the connection URL before its first run, with TLS required. Add sslmode=require. The installer then doesn’t start its own database container. See Own PostgreSQL.

Put a Load Balancer in Front

You don’t need a load balancer to run Earnie. Use one when your organisation requires all traffic to enter through it, for example for a web application firewall or a shared certificate. A load balancer must either pass TLS through to port 443 on Earnie, or re-encrypt to it. Plain HTTP from the balancer to Earnie doesn’t work. See Using a load balancer. Passing TLS through is the simpler choice. The balancer forwards TCP on port 443, and Earnie keeps its own certificate. If you use Let’s Encrypt, forward port 80 too. Use a TCP health check on port 443. Some balancers hide the client’s address when they pass TLS through, as the table shows. Earnie’s rate limits and audit log then record the balancer’s address for every request. Re-encrypting lets the balancer present its own certificate and inspect requests. Earnie then needs a certificate of its own on port 443, set with EARNIE_TLS=custom. Tell Earnie to trust the balancer’s X-Forwarded-For header, as described in Using a load balancer, or every request appears to come from the balancer. For the health check, use HTTPS on port 443 with the path /healthz, and send your Earnie name as the host if the balancer allows it.

Back Up

Back up the database, the data directory, and tenant.env, as described in Upgrading and backing up. On a cloud, you can use the provider’s tools for the first two:
  • With a managed PostgreSQL service, turn on its automated backups and point-in-time recovery. Before an upgrade, also take a manual snapshot or a pg_dump, so you can roll back to the moment just before it.
  • For the data directory, take a disk snapshot: an EBS snapshot, a persistent disk snapshot, an Azure managed disk snapshot, or a DigitalOcean Volume or Droplet snapshot. If PostgreSQL runs as a container on the same disk, stop Earnie first with docker compose stop, so the snapshot holds a database that agrees with the files.
  • Keep tenant.env apart from the machine, for example in your provider’s secret manager. It holds the keys that decrypt the credentials stored in the database.

What’s Next