tenant.env, and run one script, install.sh. To upgrade or back up later, see Upgrading and backing up.
What SCANOSS gives you
For each Earnie release, SCANOSS sends you:- The installation bundle. An archive,
earnie-bundle-vX.Y.Z.tar.gz, with the Docker Compose files, theinstall.shscript, andtenant.env.example, which lists every setting with its default. - The offline image archive. Needed only if your server can’t reach the container registry. It comes as split parts,
earnie-onprem-images-vX.Y.Z.tar.gz.part-00,part-01, and so on, with a.sha256file to check them. - A SCANOSS API key. Earnie uses it to match your code against the SCANOSS knowledge base.
vX.Y.Z on this page.
Before you begin
You need:- A server that meets the Self-hosting requirements.
- A DNS name for Earnie, such as
earnie.example.com, pointing at the server. - A PostgreSQL 16 database, or the server’s own disk space to run one as a container.
- A TLS certificate for that DNS name, unless Earnie can get one from Let’s Encrypt. See TLS certificate.
Prepare the host
On AWS, Google Cloud, Azure, or DigitalOcean, see Running Earnie on a cloud provider for the machine, disk, and network to choose.-
Install Docker. Install Docker Engine and the Docker Compose plugin from Docker’s own repository, as described in Install Docker Engine for your distribution. The package in your distribution’s own repository may be too old. Check the versions:
-
Give the data directory its own volume. Earnie keeps everything that must survive the host under one directory,
/var/lib/earnieby default. It holds scan archives, caches, certificates, and the bundled database if you use it. Mount a volume of 50 GB or more there before you install. To use another path, setEARNIE_DATA_DIRintenant.env. For example, for a new, empty disk that the server sees as/dev/sdb:Check the disk’s name withlsblkfirst: formatting the wrong disk erases it. A new ext4 file system has alost+founddirectory. Leave it there. -
Copy the bundle to the server. Extract it in a directory such as
/opt/earnie:The bundle extracts to its own directory,earnie-vX.Y.Z. That is the bundle directory: run every command on this page from it. -
Find the Docker group ID and the bridge address. You need both for
tenant.env.The first command prints the group ID, which is the value forDOCKER_GID. The second prints the Docker bridge address, which is the value forDOCKER_BRIDGE_IP. The bridge address is usually172.17.0.1.
Configure Earnie
Copy the example file and fill it in.Always edit
tenant.env. Never edit .env. The installer writes .env from tenant.env every time it runs and overwrites your changes.tenant.env is a Docker Compose environment file, not a shell script:
- Write each setting as
NAME=valueon its own line. - Don’t use quotes and don’t write
export. Quotes become part of the value. - A value runs to the end of the line, spaces included. Don’t add a trailing comment on the same line.
0600, because it holds secrets. Keep it readable only by the user who runs Docker Compose.
Identity
Host
Database
Earnie needs PostgreSQL 16. Choose one of two ways to provide it. Use your own PostgreSQL server. Create an empty database and a user that owns it. Then set the connection URL:DB_URL must match ONPREM_PG_PASSWORD.
openssl rand -hex 16, so you don’t have to escape it in the URL. The bundled database stores its files in <EARNIE_DATA_DIR>/postgres.
Leave the DATABASE_URL=${DB_URL} line as it is.
Secrets
Generate these with a random source. Each command prints 64 hexadecimal characters.
Use a different value for each of the three generated secrets. Keep a copy of
tenant.env somewhere safe. See Upgrading and backing up.
Sign-in methods
Earnie supports sign-in with a password, with single sign-on (OIDC), or both. Production installations refuse to start with neither.
Set all three OIDC values or none of them. See Single sign-on for what to enter.
Leave
EARNIE_ENV=production.
First administrator
The installer creates your organisation and its first administrator when it starts Earnie. It is safe to run again.Scanners
EARNIE_MODULES lists the scanners and features your organisation has bought, separated by commas, with no spaces.
For example,
EARNIE_MODULES=oss,crypto. Set only what your organisation has. Hardware needs depend on this list. See CPU and memory.
Other settings
Every other setting intenant.env.example has a default that works. Two are worth knowing about:
TLS certificate
Earnie serves HTTPS on port 443. TheEARNIE_TLS setting decides where its certificate comes from.
Let’s Encrypt
WithEARNIE_TLS=acme, set EARNIE_ACME_EMAIL to a monitored address. There is nothing else to do. The name in EARNIE_HOST must already point at the server, or the certificate request fails.
Your own certificate
Use this when the server has only an internal name, when it can’t reach the internet, or when your organisation issues its own certificates.-
Set
EARNIE_TLS=customintenant.env. -
Create the certificate directory. The default is
/var/lib/earnie/tls, which is<EARNIE_DATA_DIR>/tls. To use another directory, setEARNIE_TLS_DIR. -
Put two files in that directory:
The certificate must cover the name in
EARNIE_HOST.
install.sh stops before it starts anything and names the file it expects.
To renew, replace both files, then restart the proxy from the bundle directory:
Using a load balancer
You can put a load balancer in front of Earnie. It must do one of these:- Pass TLS through. Forward the TCP connection to port 443 on the Earnie server without decrypting it. Earnie’s certificate is what users see.
- Re-encrypt to Earnie. Terminate TLS on the balancer, then open a new TLS connection to port 443 on Earnie. Set
EARNIE_TLS=custom, and use a certificate that the balancer trusts.
X-Forwarded-For header. This applies when the balancer re-encrypts. A balancer that passes TLS through can’t add the header.
-
In the bundle’s
Caddyfile, add atrusted_proxiesentry to the global block at the top. Use the balancer’s own source range, never a range that clients can send from. -
In
tenant.env, add the same range afterweb:
If your certificate comes from an internal CA
Everything that connects to Earnie must trust the CA that signed Earnie’s certificate. Plan for these:Install
With access to the container registry
From the bundle directory:.env, pulls the images for your EARNIE_VERSION, starts Earnie, and waits for every service to be healthy. The registry needs credentials that SCANOSS provides. Your SCANOSS contact tells you how to sign in to it.
From the offline image archive
Use the archive when your server can’t reach the container registry.-
Copy the archive parts and the
.sha256file to the server, into the bundle directory. You need free disk space for about twice the archive’s size while you join and load it. You can delete the joined file and the parts afterwards, but keep them if you might run the installer again. See Changing configuration later. -
Set
EARNIE_VERSIONintenant.envto the archive’s version. -
Join the parts and check them:
The file has a line for the joined archive and one for each part. Every line must end in
OK. If one doesn’t, copy that file again. The.images.txtfile that comes with the archive lists the images inside it. -
Install from the archive:
The archive holds the images for open-source matching and cryptography detection. Cryptography detection runs on the same
earnie-api image, so you won’t see a separate image for it in .images.txt. The archive doesn’t include the AI provenance image. If EARNIE_MODULES includes ai, ask your SCANOSS contact how to get it.Check that Earnie is healthy
When the installer finishes, it prints the address of the health check. Open it, or request it from the command line:--cacert with the CA’s certificate, for example curl -fsS --cacert internal-ca.pem https://earnie.example.com/healthz.
A healthy Earnie answers with a success status. To see every service, including the ones that have finished:
running or healthy. The one-time services migrate, bootstrap, and data-init finish and show exited (0). That’s normal.
Sign in
Openhttps://<EARNIE_HOST> in a browser. Sign in with the administrator email and password from tenant.env, or with single sign-on if you set it up. Then continue with Workspace setup.
Single sign-on
Earnie signs users in through an OpenID Connect (OIDC) identity provider such as Microsoft Entra ID, Okta, or Keycloak.- In your identity provider, register Earnie as a web application.
-
Set its redirect URL to:
-
Copy the issuer URL, the client ID, and a client secret into
tenant.env: -
Leave
OIDC_REDIRECT_URLas it is. It already points at the address above. - Apply the change.
OIDC_CLIENT_SECRET, and apply the change. If sign-in fails with a redirect_uri_mismatch error, the redirect URL in your identity provider doesn’t match the one above.
Connecting your Git server
Earnie reads your repositories from GitHub or GitLab and posts its results on pull and merge requests. The in-app steps are the same as in the SCANOSS-hosted option. See Connecting a repository. This section covers what your self-hosted installation must provide. Your Git server must be able to reach Earnie atEARNIE_PUBLIC_BASE_URL. It delivers webhooks there, and GitHub redirects the browser there while you connect. Earnie must be able to reach your Git server too.
GitLab (self-managed)
- Version. GitLab 17.4 or later.
- Token. Create a group access token with the
apiandread_repositoryscopes. A group Owner creates it. Earnie needs the Maintainer role on each project it imports, because it registers a webhook on each one. - Reachability. Earnie only sends the token over HTTPS. GitLab must be reachable from the Earnie server over HTTPS.
- Webhooks. Earnie registers one project webhook per imported project. It points at
<EARNIE_PUBLIC_BASE_URL>/webhooks/gitlab/<connection id>. If Earnie has a private address, GitLab blocks the webhook by default. An administrator then needs to turn on Allow requests to the local network from webhooks and integrations, under Admin Area, Settings, Network, Outbound requests. Alternatively, add Earnie’s host to the allowlist on the same page. - Earnie trusts GitLab’s CA. If an internal CA signed GitLab’s certificate, paste that CA certificate into My GitLab uses an internal CA when you connect.
- GitLab trusts Earnie’s CA. If an internal CA signed Earnie’s certificate, GitLab’s administrator must add that CA to GitLab’s trusted certificates. Until they do, GitLab fails every delivery with a
certificate verify failederror. Earnie always asks GitLab to verify the certificate.
GitHub.com
Earnie connects to GitHub by creating a GitHub App for your installation.
GitHub redirects the browser to your Earnie address during the connection and sends webhooks there afterwards, so
EARNIE_PUBLIC_BASE_URL must be a name that GitHub can resolve and reach.
GitHub Enterprise Server
You can connect GitHub.com and any number of GitHub Enterprise Server hosts to the same Earnie. Choose GitHub Enterprise Server when you connect, then enter the server’s address.- Version. GitHub Enterprise Server 3.4 or later.
- Network. Earnie reaches the server over HTTPS. The server delivers webhooks to
<EARNIE_PUBLIC_BASE_URL>/webhooks/github/<server host>, so it must be able to reach Earnie. - Internal CA. If an internal CA signed the server’s certificate, paste that CA certificate when you connect. If an internal CA signed Earnie’s certificate, the server’s administrator must trust it, as for GitLab.
- Organisation. The organisation list isn’t available on Enterprise Server, so you type the organisation’s name.
- GitHub Actions. The
scanoss/earnie-cliaction works on Enterprise Server only with GitHub Connect or after you sync the action withactions-sync. Set theEARNIE_PROJECTenvironment variable, or the action’sprojectinput, because the CLI can’t work out the project from an Enterprise Server remote.
Changing configuration later
To change a setting:-
Edit
tenant.env. -
Run the installer again from the bundle directory:
If the server can’t reach the container registry, always pass the archive, even when the images are already loaded:Without it, the installer tries to pull the images, fails with
unauthorized, and changes nothing.
.env, restarts the services whose settings changed, and runs the one-time services again. That includes setting the administrator password again if EARNIE_INITIAL_ADMIN_PASSWORD is set.
Turn on a scanner later
Add the scanner toEARNIE_MODULES, for example EARNIE_MODULES=oss,crypto, and run the installer as above. The installer starts the scanner’s worker. Check that the server has the extra CPU and memory it needs first. See Self-hosting requirements.
To confirm, check that the enabled_modules list in Earnie’s GET /v1/me response includes the new scanner.
Troubleshooting
Start with the state and the logs of every service:caddy, web, earnie-api, and, when enabled, postgres, worker-crypto, and worker-ai.
What’s next
- Workspace setup covers the first steps in the app.
- Connecting a repository explains each Git connection in the app.
- Upgrading and backing up covers new releases and backups.
- Running Earnie on a cloud provider covers AWS, Google Cloud, Azure, and DigitalOcean.