Docker Compose
This page will help you get started with a production deployment using Docker Compose.
This page is not a step-by-step guide. Deploying and maintaining Aleph in production requires knowledge of the underlying technology stack. You should be familiar with system administration, security best practices, Docker, and Elasticsearch.
The templates and instructions provided are intended as a starting point, not as a fully-fledged, production-ready deployment. Make sure you understand what you are doing. You are responsible for your Aleph deployment.
Download templates
Download a copy of Aleph’s docker-compose.yml
and configuration template. These are meant to be a starting point for your deployment, not a copy-and-paste solution. Make sure you understand the templates and adjust them to fit your requirements.
curl -L https://raw.githubusercontent.com/alephdata/aleph/main/docker-compose.yml > docker-compose.yml
curl -L https://raw.githubusercontent.com/alephdata/aleph/main/aleph.env.tmpl > aleph.env.tmpl
Run the following command to create a copy of the configuration template that you can override:
cp aleph.env.tmpl aleph.env
Configure Aleph
Configure Aleph as described in Production deployment.
Elasticsearch
Aleph uses Elasticsearch to store and search data. Elasticsearch maps search indices to memory. The default operating system limits are likely too low and need to be increased. Please refer to the Elasticsearch documentation for instructions.
Start Aleph
Run the following command to migrate Aleph’s database and create Elasticsearch indices. This command makes use of the aleph
CLI that’s installed in the Aleph Docker image.
docker compose run --rm shell aleph upgrade
Finally, run the following command to start Aleph in detached mode. This means containers run in the background, so you can exit your shell session at any time without stopping the containers. Using the default Docker Compose configuration, Docker containers will restart automatically when they crash.
If you run this command for the first time, Docker Compose downloads Docker images for all services before starting the containers. This may take a while.
docker compose up -d api ui
While Aleph is running, it binds to port 8080
on the host machine. You can check that Aleph is running and accepts incoming connections using curl:
curl -i http://localhost:8080
Create an admin user
You need an admin account in order to perform certain actions via the user interface. Run the following command (replacing the placeholder values) to create an admin account:
docker compose run --rm shell aleph createuser --name="Alice" --admin --password="123abc" user@example.org
Stop Aleph
You can shut down all services using the following command:
docker compose down
Next steps
Please make sure to read the information about production deployments and adjust your setup accordingly.