Dockge Fancy Docker Stack Manager
I have been a big fan of the Uptime Kuma project by developer Louis Lam, and it is a great addition to the home lab. Louis also has a new project called Dockge, in case you have not heard about it yet. Louis describes it as “a fancy, easy-to-use and reactive self-hosted docker compose.yaml stack-oriented manager. This blog post will look into the functionalities and features of Dockge and its integration with Docker technologies like Docker Swarm, Docker Compose, and various Docker commands.
Table of contents
What is Dockge?
Dockge is a new tool from Uptime Kuma creator Louis Lam that provides a really cool web interface for managing your Docker Stacks from Docker Compose code. Note the following features provided by Dockge as noted from the official GitHub documentation:
Feature | Description |
---|---|
Manage compose.yaml | Manage your compose.yaml files, providing a central point for all your Docker configuration needs. |
Create/Edit/Start/Stop/Restart/Delete | Includes options to create, edit, start, stop, restart, and delete Docker configurations, offering full lifecycle management of your Docker environments. |
Update Docker Images | Streamline updating Docker images, ensuring your containers are always running the latest versions. |
Interactive Editor for compose.yaml | Use an interactive editor for compose.yaml, making editing and configuration more accessible and less error-prone. |
Interactive Web Terminal | Work with an interactive web terminal for direct command execution and environment management. |
Reactive and Real-Time | Experience a reactive interface where progress updates (pull, up, down) and terminal outputs are reflected in real-time. |
Easy-to-Use & Fancy UI | The UI is easy to use and is especially appealing to those who appreciate Uptime Kuma’s UI/UX. |
Convert docker run to compose.yaml | Conveniently convert docker run commands into compose.yaml format, simplifying the transition and maintenance of Docker commands. |
File-Based Structure | Dockge respects a file-based structure, ensuring compose files are stored on your drive as usual. This feature allows interaction with these files using standard Docker compose commands without locking you into a proprietary format. |
No File Kidnapping | With Dockge, your compose files are not held hostage. They remain on your drive, easily accessible for interaction through normal Docker compose commands. |
You can check out the official repo here: Dockge.
What are Docker Stacks?
Let’s get a better feel for Docker Stacks. In Docker Swarm, a service defines how Docker containers behave in production on a worker node – a critical element for any application deployment. Deploying a stack in Docker, especially using Docker Compose files, involves multiple services working in tandem, a.k.a, multiple containers.
There are also special commands that you can use to work with stacks. The docker stack deploy command, combined with a Docker Compose file, initiates the deployment process with the Docker daemon. Dockge enhances this process by providing a user-friendly interface and additional functionalities to manage these deployments effectively. Note the other docker stack commands:
docker stack ls
docker stack deploy compose
Dockge makes managing these services more straightforward with the intuitive web interface, allowing users to deploy, update, and maintain their stacks easily.
Installing the Dockge container
Dockge itself is deployed using a simple Docker Compose file that you can easily pull down from the official GitHub repository.
# Create a directory to store your stacks and the Docker Compose file
# Example below
mkdir -p /opt/stacks /opt/dockge
cd /opt/dockge
On one of my lab hosts, I have a homelabservices directory. I have subdirectories under this parent directory for all my Docker Compose services. So, here, I am creating a new folder underneath my homelabservices folder.
Download the compose.yaml file from the official GitHub repository:
# Download the compose.yaml
curl https://raw.githubusercontent.com/louislam/dockge/master/compose.yaml --output compose.yaml
Note the Docker Compose YAML file that is pulled down from the repo. ***Note*** By default, the Dockge stacks are deployed in the path: /opt/stacks. If you want to change this, you need to define the DOCKGE_STACKS_DIR environment variable and make sure your volumes /opt/stacks:opt/stacks is changed also to match.
version: "3.8"
services:
dockge:
image: louislam/dockge:1
restart: unless-stopped
ports:
# Host Port : Container Port
- 5001:5001
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./data:/app/data
# If you want to use private registries, you need to share the auth file with Dockge:
# - /root/.docker/:/root/.docker
# Your stacks directory in the host (The paths inside container must be the same as the host)
# โ ๏ธโ ๏ธ If you did it wrong, your data could end up be written into a wrong path.
# โ๏ธโ๏ธโ๏ธโ๏ธ CORRECT: - /my-stacks:/my-stacks (Both paths match)
# โโโโ WRONG: - /docker:/my-stacks (Both paths do not match)
- /opt/stacks:/opt/stacks
environment:
# Tell Dockge where is your stacks directory
- DOCKGE_STACKS_DIR=/opt/stacks
How to Update
Then start the server:
# Start the Server
docker compose up -d
You can check your Docker Compose deployment of the Dockge container using the command:
docker-compose ps
Now, you should be able to visit the web address of the Docker Container host that is hosting the Dockge instance. By default, it runs on port 5001. The first thing you will need to do is create your administrator user. You can name this anything. Then, set your password and confirm it.
Logging into Dockge, you can see the familiar interface. Also, you will see that it recognizes we already have stacks running on the Docker host. Dockge views these as unmanaged if the Docker Compose.yml code exists outside of its directory structure underneath in your folder where you created Dockge.
Dockge information detailing the existing stack is not managed by Dockge.
Working with Dockge to deploy containers
Let’s look at how you can easily deploy containers using Dockge. Click the +Compose button on the left-hand side of the interface.
Ok let’s detail the interface when you compose a new stack and edit the containers. Note the following description numbers that correspond to the areas of the screenshot below:
- Containers – here you can add additional containers to your “stack.” You can also just deploy a single container if you want as well.
- When you click Edit on the container section here, it opens all the configuration possibilities for configuring your container, including image which you can just pull ones from Docker hub, ports, volumes, restart policy, environment variables, networks, etc.
- compose.yaml – This is the visual display of the compose.yaml file which you can manually edit, or you will see populated automatically as it writes the code for you based on the options you configure in section 2. Docker Compose is your best friend when it comes to managing multiple containers. You can define multi-container Docker applications, where each service can use its own Docker image, environment variables, and configuration.
- Networks – Here you can define and create internal networks and you can toggle on External networks
Once you deploy your stack, you will start it using the Dockge UI. I really like how it shows what is going on with everything, you can see the terminal and the status of the image pull, etc.
Docker Swarm and other support coming
Docker Swarm mode, a way to run containers with high availability using the Docker engine, enables the clustering of Docker nodes into a swarm. This swarm, a group of machines running Docker and joined into a cluster can easily be provisioned using docker swarm init and then managing worker nodes and services.
Under the ideas section of the official GitHub repo, this feature may be coming to the Dockge project in the future.
Features we would like to see as part of Swarm management
With Docker Swarm it would be great to have the ability to list active services (docker service ls), deploying new stacks, and remove existing ones (docker stack rm). Using the (stack deploy compose file), managing docker services within these stacks, and even handling specific docker stack services.
Dockge Docker Stack Deploy takeaways
Dockge is a great new tool that I think many will like to get up and running in their home lab environment. With the familiarity that many have with Uptime Kuma, the Dockge project will be a great follow on to what many are already using in the lab.
The project is not as fully featured as something like Portainer with its ability to manage Swarm clusters, Kubernetes, app catalog, and many others. However, I think for a simple and easy to use Docker Compose manager, this is a great new tool that takes some of the heavy lifting out of managing your home lab and self-hosted containers.