Installation

How to install and run Alarik using Docker.

This guide will walk you through getting Alarik up and running on your system. The recommended approach is using Docker, which handles all dependencies and provides a consistent environment across platforms.

Prerequisites

Before you begin, make sure you have the following installed:

Quick Start with Prebuilt Images

The easiest way to get started is using the prebuilt Docker images from GitHub Container Registry. Create a docker-compose.yml file:

docker-compose.yml
services:
  alarik:
    image: ghcr.io/achtungsoftware/alarik:latest
    restart: unless-stopped
    ports:
      - "8080:8080"
    environment:
      - API_BASE_URL=http://localhost:8080
      - CONSOLE_BASE_URL=http://localhost:3000
      - ADMIN_USERNAME=alarik
      - ADMIN_PASSWORD=alarik
      - JWT=YOUR_SECURE_JWT_KEY
      - ALLOW_ACCOUNT_CREATION=false
    volumes:
      - alarik-storage:/app/Storage

  console:
    image: ghcr.io/achtungsoftware/alarik-console:latest
    restart: unless-stopped
    ports:
      - "3000:3000"
    environment:
      - NUXT_PUBLIC_API_BASE_URL=http://localhost:8080
      - NUXT_PUBLIC_CONSOLE_BASE_URL=http://localhost:3000
      - NUXT_PUBLIC_ALLOW_ACCOUNT_CREATION=false
    depends_on:
      - alarik

volumes:
  alarik-storage:

Then start the services:

docker compose up -d

Once started, the following services will be available:

ServiceURLDescription
APIhttp://localhost:8080S3-compatible API endpoint
Consolehttp://localhost:3000Web-based management interface

Configuration

Alarik is configured through environment variables passed directly to each Docker container.

Alarik API Variables

API_BASE_URL
string
The base URL where the Alarik API is accessible. Used for generating correct URLs in responses.
API_BASE_URL=http://localhost:8080
CONSOLE_BASE_URL
string
The base URL where the web console is accessible.
CONSOLE_BASE_URL=http://localhost:3000
ALARIK_REGION
string
The AWS region this deployment identifies as. S3 clients must sign requests for this exact region - a request signed for any other region is rejected (400 AuthorizationHeaderMalformed / AuthorizationQueryParametersError, matching real S3's behavior for a region mismatch). It's also the value GetBucketLocation/HeadBucket report, and what ReplicationTarget.region on a remote Alarik instance must match for replication to that instance to succeed. Self-hosted deployments are inherently single-region, so this is one value for the whole deployment, not a per-bucket setting.
ALARIK_REGION=us-east-1
ALARIK_FSYNC
boolean
Whether uploads are flushed to stable storage before being acknowledged With the default on, an acknowledged upload survives a power failure or crash. Setting it to false trades that guarantee for throughput: writes remain atomic (readers never see a partial object), but an acknowledged upload can be lost if the machine loses power before the OS writes its page cache back. Leave it on for production data; turning it off is meant for benchmarks and reconstructible data.On macOS, this uses F_FULLFSYNC. Expect a few milliseconds per write on Apple SSDs; this cost is far lower on typical Linux deployment hardware (NVMe with power-loss protection).
ALARIK_FSYNC=true

Console Variables

The console uses Nuxt and requires the NUXT_PUBLIC_ prefix for environment variables:

NUXT_PUBLIC_API_BASE_URL
string
The base URL of the Alarik API that the console connects to.
NUXT_PUBLIC_API_BASE_URL=http://localhost:8080
NUXT_PUBLIC_CONSOLE_BASE_URL
string
The base URL where the console is accessible.
NUXT_PUBLIC_CONSOLE_BASE_URL=http://localhost:3000
NUXT_PUBLIC_ALLOW_ACCOUNT_CREATION
boolean
Controls whether the registration form is shown in the console UI.
NUXT_PUBLIC_ALLOW_ACCOUNT_CREATION=false

Authentication

JWT
string
The secret used to sign and verify console session tokens. Required in production - a node started with --env production and no JWT set refuses to boot rather than falling back to a default, because the fallback key is a literal in a public repository and anyone could use it to mint a valid admin session. In development and testing it does fall back, logging an error.Every node in a cluster must use the same value: a session issued by one node is verified by whichever node the next request reaches. Changing it invalidates all existing sessions, which is also how you force everyone to sign in again.
JWT=YOUR_SECURE_JWT_KEY
Generate this like any other secret - for example openssl rand -base64 48. Do not reuse a value that appears in documentation or an example compose file.

A default admin user is always created on first startup. You can customize the credentials using these variables:

ADMIN_USERNAME
string
Username for the default admin account.
ADMIN_USERNAME=alarik
ADMIN_PASSWORD
string
Password for the default admin account.
ADMIN_PASSWORD=alarik
Change the default admin credentials before deploying to production. The default values are publicly known and should only be used for local development.

S3 Access Keys

You can configure default S3 access keys for the admin account:

DEFAULT_ACCESS_KEY
string
Default S3 access key ID.
DEFAULT_ACCESS_KEY=AKIAIOSFODNN7EXAMPLE
DEFAULT_SECRET_KEY
string
Default S3 secret access key.
DEFAULT_SECRET_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
These example keys are from AWS documentation and are publicly known. Always generate unique keys for production environments.

Default Buckets

DEFAULT_BUCKETS
string
A comma-separated list of buckets to create automatically at startup, owned by the seeded admin account. Handy for development and for reproducible deployments where the same buckets should always exist. Each name must be a valid S3 bucket name (lowercase); invalid names are skipped with a warning. Seeding is idempotent - buckets that already exist are left untouched, so it is safe across restarts - and buckets are created with versioning disabled.
DEFAULT_BUCKETS=uploads,media,logs

Account Settings

ALLOW_ACCOUNT_CREATION
boolean
Controls whether new accounts can be self-registered - both through the console's signup form and via SSO auto-provisioning (see OIDC SSO below). When disabled, only administrators can create new accounts, and SSO logins are limited to accounts that already exist. This should be disabled in production unless self-signup is explicitly wanted.
ALLOW_ACCOUNT_CREATION=false

OIDC SSO (optional)

Alarik supports signing in via one or more external OIDC identity providers (Okta, Google Workspace, Microsoft Entra, Keycloak, Auth0, etc.) alongside local username/password login - local login keeps working unchanged whether or not any SSO providers are configured.

Unlike most of Alarik's configuration, OIDC providers are not set via environment variables. They're managed entirely from the console by an admin, under Admin → OIDC Providers, and stored as part of Alarik's own control-plane metadata - so providers can be added, edited, or removed without restarting the deployment. Any number of providers can be configured at once; each one shows up as its own "Sign in with {name}" button on the login page.

This is deliberately admin-managed rather than a per-user setting. The client ID/secret identify the whole Alarik instance to the provider (not an individual user), and only an admin can register one - letting any user supply an arbitrary issuer URL would let them direct the server to fetch internal/internal-only addresses.

For each provider, an admin supplies:

Name
string
Display label shown on the login page, e.g. "Google" or "Company Okta".
Issuer URL
string
The identity provider's issuer URL. Alarik fetches {issuerURL}/.well-known/openid-configuration to discover the rest of the provider's endpoints, then verifies that the document's own issuer value matches what you configured - a document that names a different issuer is rejected, since otherwise a token's iss claim would only ever be checked against a value that same document supplied.Use the value the provider itself publishes as issuer (for Authentik, https://authentik.example.com/application/o/<app-slug>/). A trailing slash is optional and normalized away, but the host and path must match exactly.
Client ID
string
The OAuth client ID registered with the identity provider.
Client Secret
string
The OAuth client secret registered with the identity provider.
Enabled
boolean
Whether the provider is shown as a sign-in option. Disabling a provider doesn't delete it or unlink users.

All providers share a single callback URL, which only needs to be registered once per provider in each identity provider's own app configuration:

{API_BASE_URL}/api/v1/auth/oidc/callback

How SSO logins map to Alarik accounts

By default, a local user must already exist with its username set to the value the identity provider sends in the email claim. The first successful SSO login for that email links the two accounts to that specific provider; every login after that is matched directly by that link, even if the username is later changed. If no matching account exists, the login is rejected.

Linking (and account creation, below) only ever happens when the identity provider marks the email as verified (email_verified claim) - an unverified email is rejected outright, since it would otherwise let anyone claim an arbitrary address.

SSO auto-provisioning

When ALLOW_ACCOUNT_CREATION=true (the same switch that enables the console's signup form), an SSO login with no matching account automatically creates one instead of being rejected:

  • username is set to the verified email from the identity provider
  • the display name comes from the provider's name claim, falling back to the email
  • the account is created as a regular (non-admin) user and linked to the provider immediately
  • no usable local password is set - the account starts SSO-only; a password can be added later via account settings

When ALLOW_ACCOUNT_CREATION is unset or anything other than true, SSO can never create accounts - it strictly signs in users that already exist.

See the Admin OIDC Providers API reference to manage providers programmatically instead of through the console.

Test the API

Using the AWS CLI:

aws s3 --endpoint-url http://localhost:8080 ls

Or with curl:

curl http://localhost:8080

Create a Test Bucket

aws s3 --endpoint-url http://localhost:8080 mb s3://my-first-bucket

Building from Source (Advanced)

If you prefer to build natively without Docker, you'll need Swift 6.2 or later installed on your system.

Native builds are only supported on Linux and macOS. Windows users must use Docker.
cd alarik
swift run

For the web console (requires Node.js):

cd console
npm install
npm run dev