Self-Host Server Setup#
ℹ️ Requires an Organization plan
Technical Requirements#
A machine running latest version of Linux distribution (e.g. Ubuntu Server, CentOS, Alpine Linux)
Docker-engine version > 23.0.5 (Installation instructions in this guide)
Docker-compose version > 2.18.0 (Installation instructions in this guide)
2 CPU cores and at least 8 GiB RAM
30 GB storage on the server
Minimum 80 GB additional disk storage for data
(Optional) A user identity management service such as Azure AD or LDAP for SSO authentication.
Other Requirements#
Make sure your firewall supports HTTP2 connections. Anchorpoint uses the gRPC protocol to communicate with the server, which is based on HTTP2. It has a fallback for an HTTP1 gateway, however gRPC improves the speed and effiency of realtime updates to the Anchorpoint client. We highly recommend that you start an Anchorpoint cloud trial to evaluate whether gRPC works in your environment.
Licensing#
Licensing depends on the number of users you will have. You need to contact us for a quote. You can also request a free trial license to test the self hosted environment. We also offer volume discounts if your number of users is higher than 25. If you agree, we will send you a payment link. Once the payment is made, we will send you the license key.
Install the stack#
In the following sections we describe the setup process using our cli tool. We have a look at optional components that can be used and how to setup alternative solutions (e.g. for the database).
Installing docker#
You can install docker e.g. with apt (adjust for your linux distribution accordingly). The latest docker installations ship with docker compose v2 automatically.
sudo apt update
sudo apt install curl apt-transport-https ca-certificates software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update
sudo apt install docker-ce -y
Add the current user to the Docker group
sudo usermod -aG docker $USER
newgrp docker
Check if the user was added to the Docker group
groups $USER
To start docker as service automatically run
sudo systemctl enable docker
Setup folder structure#
Create a folder on your additional attached disk storage for the data of the Anchorpoint stack. In our example the disk is mounted on /datadrive
mkdir /datadrive/anchorpoint
cd /datadrive/anchorpoint
Cli Tool#
Download our cli tool for linux. A documentation of all its commands can be found here. The commands will be used in the following sections.
curl https://s3.eu-central-1.amazonaws.com/releases.anchorpoint.app/SelfHosted/ap-self-hosted-cli/ap-self-hosted-cli-linux-amd64 -o selfhost-cli
chmod +x selfhost-cli
Setup Environment variables before running cli install#
You can setup environment variables in your .bash_profile so that you do not have to insert them for every cli command. We will set the install directory and the license key.
cd ~/
touch .bash_profile
vim ~/bash_profile
Add the following lines (press i for insert mode in vim):
export AP_INSTALL_DIR=/datadrive/anchorpoint/install
export AP_LICENSE=<your_license_key_here>
Press escape and save with :wq and call source:
source ~/bash_profile
Check AP_INSTALL_DIR and AP_LICENSE with
echo $AP_INSTALL_DIR
echo $AP_LICENSE
Installing into the data folder#
Create a subfolder in your anchorpoint folder
mkdir /datadrive/anchorpoint/install
Call the selfhost-cli intall command
cd /datadrive/anchorpoint
./selfhost-cli install
Choose the domain where you want the backend to be reachable e.g. anchorpoint.example.com or a network IP address (e.g. 192.168.178.100). Do NOT add http:// or https:// at the start of the domain.
If you want to use https you have to enable SSL or use e.g. a load balancer for ssl termination or a reverse proxy. If you enable ssl you will be asked if you want to use Let’s Encrypt to generate an SSL certificate and store it in the data/letsencrypt directory in your install directory. If you provide an email address for Let’s Encrypt you will get notified about any certificate issues. Note that Let’s Encrypt only works with a publicly available server. If you want to provide your own ssl certificates please choose no and follow the guide in “How to use your own ssl certificates” in the next section.
MinIO is the s3 bucket alternative that can be installed in the stack and will save its data to the data/minio directory in your install directory by default. If you plan to use another s3 provider you will have to choose “no” and adjust the environment file that will be generated in the install directory. Check the next section for more information.
Postgres is the database server that will handle the Anchorpoint database and the Keycloak database. By default, its data is stored in the data/postgres directory in your install directory. If you plan to use another postgres server you will have to choose “no” and adjust the environment file that will be generated. Check the next section for more information.
If you want to see metrics and search logs you can use grafana, prometheus and loki which can be auto installed via the cli tool. You can access grafana via SERVERURL/grafana after the stack is started. You can checkout our metrics documentation for more information about metrics and logs.
Check all your inputs and finish the install process. The cli tool will download the latest package and setup the docker-compose files and the needed directories for you. Before starting the stack please read the next section to make sure that your environment is correctly setup for your usecase.
Adjust the environment file before starting the stack#
The install command will generate an .env
file in your selected install directory. This environment file contains variables for each component of the stack. You can find a description for each section of the .env
file here. Do not share this .env
file as it contains many credentials.
Name |
Default Value |
Description |
---|---|---|
Stack Global |
||
|
|
The name of the stack for Docker Compose. |
Domain |
||
|
Domain from cli install |
The domain or IP address where the stack is hosted. |
|
|
The port for HTTP / HTTPS traffic. |
|
|
The port for gRPC traffic. |
|
|
The HTTP scheme used (http or https). |
Traefik |
||
|
|
Path to store Traefik data. |
|
Set from cli install when provided |
(Optional) Email for Let’s Encrypt notifications. |
Keycloak |
||
|
|
Default admin user for Keycloak. |
|
Auto generated from cli install |
Default admin password for Keycloak. |
|
Auto generated from cli install |
Secret for the admin CLI client. |
|
Auto generated from cli install |
Secret for the dashboard client. |
Anchorpoint Backend |
||
|
Set from cli install |
License key for the Anchorpoint Backend. |
|
Set from cli install |
Identifier for the default workspace all users get invited to from the dashboard. |
|
|
Name of the default workspace on first creation. |
|
Auto generated from cli install |
Secret for dashboard session. |
|
false |
Allow crash reporting to our servers for crashes in the desktop client. Note that crashes attach log data that can contain sensitive information |
|
Smpt email host |
|
|
|
Smpt email port |
|
Smpt email username |
|
|
Smpt email password |
|
|
|
Path to provide client updates data. |
Postgres |
||
|
Auto generated from cli install |
Password for the PostgreSQL database. |
|
|
User for the PostgreSQL database. |
|
|
Address of the PostgreSQL database. |
|
|
Port for the PostgreSQL database. |
|
|
Database name for PostgreSQL. |
|
|
Path to store PostgreSQL data. |
RabbitMq |
||
|
|
User for RabbitMQ. |
|
Auto generated from cli install |
Password for RabbitMQ. |
|
Auto generated from cli install |
Cookie secret for RabbitMQ. |
MinIO |
||
|
|
Access key for MinIO. |
|
Auto generated from cli install |
Secret key for MinIO. |
|
Domain from cli install |
Domain name for MinIO. |
|
|
Port for MinIO. |
|
|
Dashboard port for MinIO. |
|
|
Path to store MinIO data. |
|
|
Whether to create a MinIO bucket on startup. |
|
|
Whether to create a MinIO bucket with a policy. |
|
|
Whether MinIO uses path-style access. |
Other S3 Provider |
||
|
Access key for S3 storage. |
|
|
Secret key for S3 storage. |
|
|
|
URL for S3 server. |
|
|
Internal URL for S3 server. |
|
|
External URL for S3 server. |
|
|
Whether to use SSL for S3 connections. |
|
|
Bucket name for S3 storage. |
|
Region for S3 storage. |
|
|
|
Whether to create an S3 bucket on startup. |
|
|
Whether to create an S3 bucket with a policy. |
|
|
Whether S3 uses path-style access. |
Grafana |
||
|
|
UserID for grafana container. |
|
|
GroupID for grafana container. |
|
|
User for grafana login. |
|
Auto generated from cli install |
Password for grafana login. |
|
|
Path to store grafana data. |
|
|
Path to store prometheus data. |
|
|
Path to store loki data. |
(Optional) How to use your own ssl certificates#
If you selected to use your own ssl certificates (self signed also possible) in the stack, you have to place your certificates in the data/traefik/certs directory in your install directory and adjust the data/traefik/dynamic_conf.yaml file in your install dictory to reference all your certificates. An example file content could look like this:
tls:
certificates:
- certFile: /data/traefik/certs/cert1.crt
keyFile: /data/traefik/certs/cert1.key
- certFile: /data/traefik/certs/cert2.crt
keyFile: /data/traefik/certs/cert2.key
Note that the path in the config file is the path to the certificates inside the docker container not the path at the host. So keep it as /data/traefik/certs/
in the dynamic_conf.yaml and only adjust the name of the certificate/s and the key/s. Also note that if you have intermediate certificates you have to create one crt file with first the server certificate followed by any intermediate certificates in the same file.
You can also find more information about the dynamic_conf.yaml on the traefik documentation here.
(Optional) How to send emails for user mentions#
If you want the Anchorpoint backend to send emails when a user is invited or mentioned in a comment you have to setup the EMAIL_
environment variables for smtp. You can also adjust the email templates from config/ap_backend/templates/email directory.
(Optional) How to store data on a different path#
If you want to change the data paths of Postgres, MinIO, Traefik, or the Anchorpoint Backend Client update folder, you can adjust the according ..._PATH
environment variables before starting the stack.
(Optional) How to use a custom Postgres server#
If you want to use your own postgres database server, do not choose postgres in the cli install command. Create two databases ap
and keycloak
on your database server. Setup the according POSTGRES_
environment variables in the .env
file before starting the stack.
(Optional) How to make additional adjustments to the docker compose file#
If you want to adjust the generated docker-compose file created by the cli tool, please use overwrites by creating a new yaml file next to the existing docker-compose file. If you directly change the original docker-compose file the cli update command will overwrite your changes. The cli start command will consider all compose files in your installation directory when starting the stack.
Start the stack#
To start the stack you must use the cli tool start command.
./selfhost-cli start
Internally it will use docker compose up -d
but it will also respect configration overwrites. An overview about the state of the containers will be printed. The ap_backend
container will only start if the depending containers get into a healthy
state. After all containers are started you can check if the Anchorpoint web dashboard is reachable under http{s}://{your_domain}/dashboard
. Be aware that it might take a few minutes for the dashboard to be reachable.
Troubleshooting start problems#
If the containers do not start, or you cannot reach them via your provided domain or IP address, first check the container log outputs. You can use docker ps -a
to view all running containers. Copy the container id and use docker logs {container_id}
to print the latest container log outputs.
Also check that your DNS records are setup correctly if you are using a custom domain and that your firewall allows connections on the http / https port, the gprc port, and the MinIO ports.
(Optional) Setup your SSO provider in Keycloak#
Checkout our guide for SSO provider in Keycloak here.
Setup user accounts#
Checkout our guide for managing users in your self hosted environment here. After you set up the user accounts, login via the Anchorpoint desktop client as described here.
How to update the stack#
To update the stack, run the cli tool update command.
./selfhost-cli update
In case an update is available, it will download the latest version of the stack, including the latest Anchorpoint backend and client versions. The update will overwrite files in the installation directory, but will not change anything in your data directories. You can also use the check_update command to check if there is a new version available.
After the update is finsihed you can restart the stack by running the cli start command again. Note that while updating, the Anchorpoint clients will be in the offline mode. We generally recommend updating the stack after work when no users are currently using the application.
How to update your license#
Adjust your .bash_profile AP_LICENSE environment variable:
cd ~/
touch .bash_profile
vim ~/bash_profile
ADjust the following line (press i for insert mode in vim):
export AP_LICENSE=<your_license_key_here>
Press escape and save with :wq and call source:
source ~/bash_profile
Check AP_LICENSE contains your new license key with
echo $AP_INSTALL_DIR
echo $AP_LICENSE
You can update the self-hosting license by using the cli tool update_license command.
./selfhost-cli update_license
The command will stop and remove the ap_backend container, patch the .env
file LICENSE_KEY
environment variable and recreate the ap_backend container for you. Note that this will also result in a short downtime while the ap_backend container is not running. Similar to updating, we recommend updating the license when no users are currently using the application.
How to stop the stack#
To stop the stack you can use the cli tool stop command or use docker-compose stop
in your installation directory.
Data that should be backed up regularly#
You should regularly backup the data directories in your install directory. Also do a backup if you changed the data paths from their current location. You can restore the Anchorpoint backend state by restoring the database and MinIO directories.