Using Docker
Deploy FiveNet with Docker Engine and the Docker Compose plugin on a single server.
1. Install Docker Engine and Docker Compose
You need Docker Engine as the container runtime and the Docker Compose plugin to run FiveNet using containers.
Please use one of the many guides available on the internet to install Docker Engine and Docker Compose on your server, for example https://docs.docker.com/engine/install/.
Depending on your server's operating system, make sure to start the Docker Daemon using systemctl start docker .
To check that Docker and the Docker Compose plugin are ready, you can use the following commands:
docker version
docker compose version
You can now continue with preparing the docker-compose.yaml file for your setup.
2. Prepare docker-compose.yaml
Use the docker-compose.yaml example file as a starting point.
Review the example file and adjust it for your environment before starting the stack. In particular, make sure to check:
- The image tags you want to deploy (e.g., a release or a development version).
- It is recommended to use the latest stable release tag for production deployments, you shouldn't
latesttag.
- It is recommended to use the latest stable release tag for production deployments, you shouldn't
- Environment variables and mounted files.
- Database, NATS, and other service connection settings.
- Domain or reverse-proxy related settings if you expose FiveNet externally.
If you already have a Docker NGINX Reverse Proxy or a similar solution for exposing your container applications to the internet, you can remove or comment out the nginx-proxy container from the example file.
When using the Docker NGINX Reverse Proxy, make sure to update the environment variables of each container so they match the domain or subdomain you want to use.
If you use the NATS server from the default docker-compose.yaml, the nats.url in your FiveNet config.yaml should look like this: url: "nats://fivenet:fivenet_topsecret@localhost:4222".
2.1. Prepare FiveNet Config
Check the configuration reference page "Must Set Config Options" section and reference list to create a working config.yaml for FiveNet.
2.2. Prepare FiveNet DBSync Config
Check the DBSync page to create a working dbsync.yaml for FiveNet DBSync.
3. Run FiveNet
Pull the latest container images and start the server, dbsync, worker, and discord bot containers:
docker compose pull
docker compose up -d
4. Verify the Deployment
After the containers are running, verify that the stack started correctly:
docker compose ps
docker compose logs --tail=100
Make sure the FiveNet containers are healthy and that the application is reachable through your configured domain, reverse proxy, or local access path.
5. Reverse Proxy Recommendations
If you are not already using a reverse proxy to expose FiveNet, consider a solution such as nginx-proxy/nginx-proxy to safely expose the FiveNet server (/) and the Iconify API container (/api/icons).
5.1. Configuring Traefik as a Reverse Proxy
If you prefer using Traefik as your reverse proxy, follow these steps to configure it for FiveNet:
- Install Traefik: Refer to the Traefik documentation for installation instructions.
- Start Traefik: Run Traefik alongside your FiveNet containers using Docker Compose.
- HTTPS/TLS Setup: Follow the Traefik HTTPS/TLS setup documentation to configure secure connections.
- Ensure GRPC/H2C support is enabled for the service. Refer to Traefik GRPC With HTTP (h2c) for more guidance.
- Label the Containers: Add the following labels to the FiveNet server container in your
docker-compose.yamlfile:labels: - "traefik.enable=true" - "traefik.http.routers.fivenet.rule=Host(`your-domain.com`)" - "traefik.http.routers.fivenet.entrypoints=websecure" - "traefik.http.routers.fivenet.tls.certresolver=myresolver" - "traefik.http.services.fivenet.loadbalancer.server.scheme=h2c" - Verify Configuration: Ensure that your domain points to the server's IP and that Traefik is correctly routing traffic to the FiveNet containers.
This setup allows you to securely expose FiveNet to the internet using Traefik.
6. Post-Installation Steps
Make sure to follow the post-installation steps now.
Troubleshooting
If you face issues during the containerized installation, such as database collation mismatches, check the Common Installation Issues page for solutions.
Cloud
FiveNet Cloud is available today as a managed hosting option for communities that want us to run and maintain FiveNet for them.
Kubernetes: Using Helm
For installation to Kubernetes, a Helm chart is available in our charts repository. The source code of the chart(s) is available on GitHub fivenet-app/charts.
