Self-hosting

Self-Hosting with Docker

⚠️

For workflow development purposes, we highly recommend running Admyral via the Admyral CLI. The purpose of docker compose is rather for development and deployment.

Docker is the easiest way to get started with self-hosted Admyral. This guide assumes you are running the command from the machine you intend to host from.

If you need any support with setting up Admyral, please join us on Discord (opens in a new tab).

Prerequisites

You need to have the following installed on the machine you intend to host from:

Running Admyral

Follow these steps to start Admyral:

# Clone the repository
git clone https://github.com/Admyral-Security/admyral.git
 
# Change directory to docker self-hosting
cd admyral/deploy/docker-compose
 
# Copy the env vars
cp .env.example .env
 
# Source the environment variables
source .env
 
# Start the services in detached mode
docker compose up -d

After Admyral has started, you can see the containers running in the background:

docker compose ps

Accessing Admyral

Admyral is now running on your machine on port 3000. For example, http://your-ip:3000 or http://localhost:3000 if you are running Docker locally.

Securing Admyral

Inside the .env file, we provided you with some example secrets for getting easily started. However, you should change these secrets to secure your Admyral instance as soon as possible. You should replace the following secrets in your .env file inside the deploy/docker-compose directory:

POSTGRES_PASSWORD=...
ADMYRAL_SECRETS_ENCRYPTION_KEY=...
ADMYRAL_WEBHOOK_SIGNING_SECRET=...

To generate new secrets, you can run the following commands from the project root directory:

# Change directory to scripts
cd scripts
 
# Generate new secrets
./generate_secrets.sh

After generating new secrets, you need to update the environment variables in the .env file inside deploy/docker-compose with the new secrets. Afterwards, you need to restart Admyral.

Restarting all services

To restart all services, run the following command inside the deploy/docker-compose directory:

docker compose restart

Stopping all services

To stop all services, run the following command inside the deploy/docker-compose directory:

docker compose down

Uninstalling Admyral

To uninstall Admyral, run the following command inside the deploy/docker-compose directory:

# Stop docker and remove volumes:
docker compose down -v
 
# Remove Postgres data:
rm -rf volumes/db/data/

Pulling the latest version of Admyral

In order to get the latest version of Admyral, run the following commands inside the deploy/docker-compose directory:

# Stop docker
docker compose down
 
# Pull the newest images from the docker hub
docker compose pull
 
# Start Admyral
docker compose up -d