Skip to content

Installation

Nine steps, about an hour the first time. Check the Requirements first. With Docker there is a shorter way: Docker Compose below.

  1. Register an EVE application
  2. Set up PostgreSQL
  3. Get and build Nexus
  4. Create the configuration
  5. First start
  6. Sign in and make yourself superadmin
  7. Put it behind HTTPS
  8. Run it as a service
  9. Final checks

Docker Compose (shortest path)

The repository's docker-compose.yml runs Nexus and PostgreSQL 17, and optionally the HTTPS front end. You still need step 1 (the EVE application) and step 6 (making yourself superadmin).

git clone https://github.com/Thrainkrilleve/Eve-Nexus.git
cd Eve-Nexus
cp .env.example .env

In .env, set at least:

Setting Value
POSTGRES_PASSWORD A long random password, letters and digits only
VAULT_MASTER_KEYS 1: followed by 64 hex characters (see step 4). Back it up.
EVE_CLIENT_ID, EVE_CLIENT_SECRET From step 1
PUBLIC_URL The address pilots use, for example https://auth.example.com

The compose file sets DATABASE_URL, BIND_ADDR and TRUSTED_PROXIES itself; values for those in .env are ignored. Then start it one of two ways:

docker compose up -d                     # this machine only, or with the built-in Cloudflare Tunnel
docker compose --profile caddy up -d     # Caddy gets a certificate for NEXUS_DOMAIN (ports 80, 443)
  • Caddy: set NEXUS_DOMAIN=auth.example.com and point its DNS at this server first.
  • Cloudflare Tunnel: built in; nothing extra to run. Start without a profile, sign in at http://localhost:8080 and follow Option A in step 7. The image already contains cloudflared.

The first up builds the image from source (about 10 minutes; later builds reuse the cache). Nexus waits for PostgreSQL to report healthy, then creates its tables. docker compose logs -f nexus should end with "EVE Nexus core-api listening". Continue with step 6, using docker compose exec postgres psql -U nexus_owner -d nexus for the SQL.


1. Register an EVE application

  1. Go to https://developers.eveonline.com, sign in, open Applications and choose Create new application.
  2. Connection type: Authentication & API Access.
  3. Permissions (scopes): add every scope Nexus may ask for. Every sign-in asks EVE for the categories chosen on Admin → Organisation → What Nexus asks pilots for (all of them until you choose), and EVE refuses the sign-in if the application doesn't allow one of them. The full list (the page shows the exact set in use):
publicData esi-characters.read_corporation_roles.v1 esi-skills.read_skills.v1 esi-skills.read_skillqueue.v1 esi-clones.read_clones.v1 esi-clones.read_implants.v1 esi-universe.read_structures.v1 esi-location.read_location.v1 esi-location.read_ship_type.v1 esi-location.read_online.v1 esi-characters.read_contacts.v1 esi-characters.read_standings.v1 esi-killmails.read_killmails.v1 esi-corporations.read_contacts.v1 esi-alliances.read_contacts.v1 esi-wallet.read_character_wallet.v1 esi-assets.read_assets.v1 esi-contracts.read_character_contracts.v1 esi-mail.read_mail.v1 esi-markets.read_character_orders.v1 esi-characters.read_notifications.v1

Also add esi-wallet.read_corporation_wallets.v1 if leaders will connect corporation wallets (Management → Corp Wallets). Only that connect sign-in asks for it.

You can add more later; pilots get new scopes the next time they sign in. 4. Callback URL: your public address followed by /sso/callback. It must match PUBLIC_URL exactly, including https:// and with no trailing slash: - Production: https://auth.example.com/sso/callback - Local testing: http://localhost:8080/sso/callback 5. Save. Copy the Client ID and the Secret Key.

The Secret Key is a Secret. Store it in a password manager. If it leaks, regenerate it on the same page and update EVE_CLIENT_SECRET.

2. Set up PostgreSQL

Any PostgreSQL 17+ works. Nexus uses two roles. The owner creates and updates the tables. The app role is what the API connects as: it can read and write rows, and it cannot change the schema or turn off the audit trigger.

Docker (simplest):

docker run -d --name nexus-pg --restart unless-stopped \
  -e POSTGRES_USER=nexus_owner -e POSTGRES_PASSWORD='<owner-password>' -e POSTGRES_DB=nexus \
  -e POSTGRES_APP_PASSWORD='<app-password>' \
  -v nexus-pg-data:/var/lib/postgresql/data \
  -v "$PWD/docker/postgres/init-app-role.sh:/docker-entrypoint-initdb.d/10-app-role.sh:ro" \
  -p 127.0.0.1:5432:5432 postgres:17-alpine

Bind it to 127.0.0.1 as shown, so the database isn't reachable from the internet. The init script runs only on a new data volume. Passwords are letters and digits only.

Existing PostgreSQL server:

CREATE ROLE nexus_owner LOGIN PASSWORD '<owner-password>';
CREATE ROLE nexus_app LOGIN PASSWORD '<app-password>';
CREATE DATABASE nexus OWNER nexus_owner;
GRANT CONNECT ON DATABASE nexus TO nexus_app;

Connect once as nexus_owner and set DATABASE_MIGRATE_URL to that role. Set DATABASE_URL to nexus_app. On startup Nexus migrates as the owner, which grants nexus_app use of the tables (migration 0021). A single-role install still works: set only DATABASE_URL to a role that owns the database, and leave DATABASE_MIGRATE_URL unset.

3. Get and build Nexus

git clone https://github.com/Thrainkrilleve/Eve-Nexus.git
cd Eve-Nexus
cd web && npm install && npm run build && cd ..     # must run first: the server embeds web/dist
cargo build --release -p core-api

The result is one file: target/release/core-api (core-api.exe on Windows).

Build the web interface before the server. If you skip it, the site only shows "EVE Nexus Core API is running. Build web/dist…".

4. Create the configuration

Copy the template and fill it in:

cp .env.example .env

Generate the vault key, which encrypts every pilot's ESI token:

python3 -c "import secrets;print('1:'+secrets.token_hex(32))"

On Windows without Python, use PowerShell (cryptographically secure):

$b = New-Object byte[] 32; [Security.Cryptography.RandomNumberGenerator]::Create().GetBytes($b); '1:' + -join ($b | % { $_.ToString('x2') })

Minimum .env for production:

DATABASE_URL=postgres://nexus_app:<app-password>@127.0.0.1:5432/nexus
DATABASE_MIGRATE_URL=postgres://nexus_owner:<owner-password>@127.0.0.1:5432/nexus
VAULT_MASTER_KEYS=1:<64 hex characters>
EVE_CLIENT_ID=<client id from step 1>
EVE_CLIENT_SECRET=<secret key from step 1>
PUBLIC_URL=https://auth.example.com
BIND_ADDR=127.0.0.1:8080
TRUSTED_PROXIES=127.0.0.1/32

Every setting is explained in Configuration.

Back up VAULT_MASTER_KEYS now, somewhere other than the server (a password manager). If you lose it, every stored token is unreadable and every pilot must sign in again. The whole .env file is Secret: restrict it to the account that runs Nexus (chmod 600 .env on Linux).

5. First start

Run it from the folder that holds .env:

./target/release/core-api

A healthy first start logs, in order:

Loaded environment from .env
EVE SSO configured client_id=… client_secret="set"
PostgreSQL connected and migrations verified
EVE Nexus core-api listening bind=127.0.0.1:8080 public_url=https://auth.example.com
New CCP SDE release detected; importing …
SDE import committed release=… types=… systems=…

The static data import takes 10–60 seconds. Until it finishes, items and systems show as numbers.

If it stops with an error instead, look it up in Troubleshooting.

6. Sign in and make yourself superadmin

  1. Open PUBLIC_URL in a browser (for local testing, http://localhost:8080).
  2. Choose Sign in with EVE Online and log in with your main character.
  3. New accounts start as Guest with no admin rights. Promote your own account once, from the database:
docker exec -it nexus-pg psql -U nexus -d nexus -c \
 "WITH promoted AS (
    UPDATE accounts SET is_superadmin = TRUE
    WHERE id = (
      SELECT account_id FROM characters
      WHERE character_name = '<Your Main Name>' AND is_main
    )
    RETURNING id
  )
  INSERT INTO audit_logs (actor_account_id, action, target_type, target_id, metadata)
  SELECT id, 'account.superadmin_granted', 'account', id::text, '{\"via\":\"install\"}'::jsonb
  FROM promoted;"

The output should say INSERT 0 1. Refresh the page and the Admin section appears in the menu. Only do this for people who should have full control. A superadmin bypasses every permission check. The is_main match means a renamed alt is not enough. A second factor for this grant is the admin MFA follow-up (docs/design/admin-mfa.md).

7. Put it behind HTTPS

Nexus speaks plain HTTP. Something in front of it must provide HTTPS. Pick one.

Option A: Cloudflare Tunnel (no open ports)

Nexus can create the tunnel, its public hostname and the DNS record. cloudflared runs in its own container, with only the connector token. You need a domain on Cloudflare.

  1. Create a Cloudflare API token at https://dash.cloudflare.com/profile/api-tokens (Create Token → Create Custom Token) with these three permissions:
  2. Account › Cloudflare Tunnel › Edit
  3. Zone › DNS › Edit
  4. Zone › Zone › Read

Limit Zone Resources to the domain Nexus will use. 2. In .env set the address pilots will use, then restart:

PUBLIC_URL=https://auth.example.com
TRUSTED_PROXIES=127.0.0.1/32
TRUST_CLOUDFLARE_IPS=true
Compose already trusts the connector's address as well. 3. On the server, open http://localhost:8080, sign in as a superadmin and open Admin → Tunnel. Enter the hostname (auth.example.com) and paste the API token, then Create the tunnel. If that name already has a DNS record, Nexus stops and says so; choose Replace the record only if the old record can go (for example, it pointed at an older tunnel). 4. The page shows the connector token once and does not store it. Put it in CLOUDFLARE_TUNNEL_TOKEN and run docker compose up -d. The public hostname's service must be http://nexus:8080. Open https://auth.example.com and sign in there from now on.

Nexus does not store the Cloudflare API token either. Paste it again to change the hostname or to remove the tunnel. It does not start cloudflared. Remove deletes the tunnel and its DNS record at Cloudflare. Stop the connector with docker compose stop cloudflared if Cloudflare says a connection is still up. There is no in-app on/off switch for the connector.

While PUBLIC_URL points at the tunnel, http://localhost:<port> still works for admins on the server itself, so you can't lock yourself out if the tunnel is down.

Already have a tunnel? Set CLOUDFLARE_TUNNEL_TOKEN to the connector token: the long eyJ... string from the dashboard's install command, not the tunnel id. Compose runs cloudflared as its own service, so the public hostname's service must be http://nexus:8080. There is no compose profile for the tunnel. The Tunnel page then stays read only.

Upgrading an install that ran cloudflared inside the nexus container. The public hostname's service used to be http://127.0.0.1:8080, which was the API process in that same container. After this change the connector is a different container, so that address is its own loopback and the tunnel will not reach Nexus. In the Cloudflare dashboard, set the public hostname's service to http://nexus:8080, keep CLOUDFLARE_TUNNEL_TOKEN in .env, and run docker compose up -d. The nexus service no longer receives the token. A tunnel created on Admin → Tunnel before this change still has the old origin at Cloudflare; open Admin → Tunnel, save the hostname again (that rewrites the origin), copy the new connector token into CLOUDFLARE_TUNNEL_TOKEN, and recreate the containers.

An install that still has the old <project>_nexus network on 172.31.250.0/24 fails that docker compose up with Pool overlaps with other one on this address space. The new edge network uses the same subnet, and Docker will not create it while the old network remains. Run docker compose down, then docker network rm <project>_nexus, then docker compose up -d. This compose file sets the project name to eve-nexus, so the network is eve-nexus_nexus unless the project name was overridden.

Outside Docker, run cloudflared yourself, as a user that cannot read VAULT_MASTER_KEYS or the database password, and point it at http://127.0.0.1:8080. Do not put CLOUDFLARE_TUNNEL_TOKEN in the same .env the API loads.

Option B: Caddy (automatic certificates)

auth.example.com {
    reverse_proxy 127.0.0.1:8080
}

Caddy sends X-Forwarded-For and X-Forwarded-Proto for you. Keep TRUSTED_PROXIES=127.0.0.1/32.

Option C: nginx

server {
    listen 443 ssl http2;
    server_name auth.example.com;
    # ssl_certificate / ssl_certificate_key from certbot

    location / {
        proxy_pass http://127.0.0.1:8080;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

Whichever you choose: PUBLIC_URL must be the exact address pilots type, and the EVE application's callback must be PUBLIC_URL/sso/callback. After the switch, open Admin → System Health. It should report Detected protocol: https and no warnings.

8. Run it as a service

Linux (systemd)

sudo useradd --system --home /opt/eve-nexus --shell /usr/sbin/nologin nexus
sudo mkdir -p /opt/eve-nexus
sudo cp target/release/core-api /opt/eve-nexus/
sudo cp .env /opt/eve-nexus/.env
sudo chown -R nexus:nexus /opt/eve-nexus && sudo chmod 600 /opt/eve-nexus/.env

/etc/systemd/system/eve-nexus.service:

[Unit]
Description=EVE Nexus
After=network-online.target postgresql.service docker.service
Wants=network-online.target

[Service]
User=nexus
WorkingDirectory=/opt/eve-nexus
ExecStart=/opt/eve-nexus/core-api
Restart=on-failure
RestartSec=5
NoNewPrivileges=true
ProtectSystem=strict
ProtectHome=true
PrivateTmp=true

[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable --now eve-nexus
journalctl -u eve-nexus -f        # live logs

Windows

Use a service wrapper such as NSSM (https://nssm.cc):

nssm install EVENexus C:\EVE-Nexus\core-api.exe
nssm set EVENexus AppDirectory C:\EVE-Nexus
nssm set EVENexus AppStdout C:\EVE-Nexus\logs\nexus.log
nssm set EVENexus AppStderr C:\EVE-Nexus\logs\nexus.log
nssm start EVENexus

Put .env in C:\EVE-Nexus and limit its permissions to administrators and the service account.

9. Final checks

  • [ ] https://auth.example.com loads, and Sign in with EVE Online works from a phone on mobile data (outside your network).
  • [ ] Admin → System Health shows Status ok, Database connected, an SDE release, protocol https, and no warnings.
  • [ ] Linking an alt works: Characters & Tokens → + Link Alt Character.
  • [ ] VAULT_MASTER_KEYS and the EVE secret are in your password manager.
  • [ ] Database backups are scheduled (Operations → Backups).
  • [ ] The service restarts after a reboot.

Done. Pilots can now sign in at your public address.