Installation
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:
- Docker (version 20.10 or later recommended)
- Docker Compose (usually included with Docker Desktop)
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:
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:
| Service | URL | Description |
|---|---|---|
| API | http://localhost:8080 | S3-compatible API endpoint |
| Console | http://localhost:3000 | Web-based management interface |
Configuration
Alarik is configured through environment variables passed directly to each Docker container.
Alarik API Variables
API_BASE_URL=http://localhost:8080
CONSOLE_BASE_URL=http://localhost:3000
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
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=http://localhost:8080
NUXT_PUBLIC_CONSOLE_BASE_URL=http://localhost:3000
NUXT_PUBLIC_ALLOW_ACCOUNT_CREATION=false
Authentication
--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
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=alarik
ADMIN_PASSWORD=alarik
S3 Access Keys
You can configure default S3 access keys for the admin account:
DEFAULT_ACCESS_KEY=AKIAIOSFODNN7EXAMPLE
DEFAULT_SECRET_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Default Buckets
DEFAULT_BUCKETS=uploads,media,logs
Account Settings
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.
For each provider, an admin supplies:
{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.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:
usernameis set to the verified email from the identity provider- the display name comes from the provider's
nameclaim, 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.
cd alarik
swift run
For the web console (requires Node.js):
cd console
npm install
npm run dev