Apikee

Self-Hosting

Run the full Apikee platform on your own server in minutes with a single setup script.

Self-Hosting

Run Postgres, MongoDB, MinIO, and the Apikee platform on any Linux server — no cloud account required.

The setup script handles Docker installation, secret generation, and first-run configuration automatically. On a fresh server it takes under 5 minutes.

One-liner install

curl -fsSL https://get.apikee.com/setup.sh | sudo bash

The script is idempotent — re-running it on an existing install is safe.

What the script does

Detect your OS

Supports Ubuntu 20.04+, Debian 11+, RHEL / Rocky / AlmaLinux 8+, and Fedora 38+. Exits early with a clear message on unsupported systems.

Install Docker and Docker Compose

Adds the official Docker apt/yum repository and installs:

  • docker-ce, docker-ce-cli, containerd.io
  • docker-buildx-plugin, docker-compose-plugin

Skipped silently if Docker is already present.

Configure the environment

Creates /opt/apikee/.env from the upstream template, then auto-generates:

VariableHow it's set
APIKEE_SECRETopenssl rand -hex 32
POSTGRES_PASSWORDopenssl rand -base64 18
MONGO_PASSWORDopenssl rand -base64 18
MINIO_SECRET_KEYopenssl rand -base64 18

You are prompted for your domain / IP and, optionally, an admin account to seed on first start.

Start the stack

docker compose -f /opt/apikee/docker-compose.yml --env-file /opt/apikee/.env up -d

Services started: postgres, mongo, minio, api (Apikee).

Manual setup

If you prefer to configure everything yourself:

# 1. Create the install directory
mkdir -p /opt/apikee && cd /opt/apikee

# 2. Download the compose file and env template
curl -fsSL https://raw.githubusercontent.com/apikee-dev/apikee/main/docker-compose.yml -o docker-compose.yml
curl -fsSL https://raw.githubusercontent.com/apikee-dev/apikee/main/.env.example    -o .env

# 3. Fill in the required values
#    At minimum: APIKEE_SECRET, POSTGRES_PASSWORD, MONGO_PASSWORD, MINIO_SECRET_KEY, APP_URL
nano .env

# 4. Generate a signing secret (paste into .env)
openssl rand -hex 32

# 5. Start
docker compose up -d

Environment reference

VariableRequiredDescription
APP_URLPublic URL, e.g. https://apikee.yourco.com
APIKEE_SECRETHMAC signing key — keep this secret
POSTGRES_PASSWORDInternal Postgres password
MONGO_PASSWORDInternal MongoDB password
MINIO_SECRET_KEYMinIO root password
ADMIN_EMAILSeeds an admin account on first start
ADMIN_PASSWORDPassword for the admin account above
SETUP_COMPLETESet true to skip the setup wizard
PORTHost port (default 4321)
SMTP_HOSTSMTP server for email notifications
APIKEE_PREMIUMLicense key for AI features

Port

Apikee runs on port 4321 by default. To change it, set PORT in your .env:

PORT=8080

The port mapping in docker-compose.yml reads this value automatically.

Updating

cd /opt/apikee
docker compose pull
docker compose up -d

Database migrations run automatically on container startup — no manual steps needed.

Useful commands

# View logs (all services)
docker compose -C /opt/apikee logs -f

# View logs (Apikee only)
docker compose -C /opt/apikee logs -f api

# Stop the stack
docker compose -C /opt/apikee down

# Stop and remove all data (destructive)
docker compose -C /opt/apikee down -v

down -v removes all database volumes. Back up your data first.

Backups

Postgres and MongoDB data live in named Docker volumes (postgres_data, mongo_data). Back them up with:

# Postgres
docker exec apikee-postgres-1 pg_dump -U apikee apikee | gzip > apikee-pg-$(date +%F).sql.gz

# MongoDB
docker exec apikee-mongo-1 mongodump --archive --gzip \
  --username apikee --password "$MONGO_PASSWORD" \
  | gzip > apikee-mongo-$(date +%F).archive.gz

Reverse proxy (nginx)

server {
    listen 80;
    server_name apikee.yourco.com;
    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl;
    server_name apikee.yourco.com;

    ssl_certificate     /etc/letsencrypt/live/apikee.yourco.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/apikee.yourco.com/privkey.pem;

    location / {
        proxy_pass         http://127.0.0.1:4321;
        proxy_http_version 1.1;
        proxy_set_header   Upgrade $http_upgrade;
        proxy_set_header   Connection "upgrade";
        proxy_set_header   Host $host;
        proxy_set_header   X-Real-IP $remote_addr;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header   X-Forwarded-Proto $scheme;
    }
}

On this page