How to Install Docker on Void Linux Step by Step#
Docker makes it easy to build, deploy, and manage containerized applications. In this guide, you will learn how to install Docker on Void Linux, enable the Docker service, and configure Docker for non-root users.
Prerequisites#
Before installing Docker, make sure you:
- Have a working Void Linux system
- Have sudo privileges
- Have an internet connection
Update Your System#
First, update your package database and upgrade installed packages.
sudo xbps-install -SuIf updates are available, confirm the installation and wait for the process to finish.
Install Docker on Void Linux#
Install Docker using the XBPS package manager.
sudo xbps-install -S dockerThis command installs the Docker Engine and required dependencies.
Enable the Docker Service#
Void Linux uses runit instead of systemd. To enable the Docker service, create a symbolic link to the service directory.
sudo ln -s /etc/sv/docker /var/service/Start and Check Docker Status#
Verify that the Docker service is running.
sudo sv status dockerYou should see output similar to:
run: docker: (pid 1234) 10sRun Docker Without sudo#
By default, Docker commands require root privileges. Add your user to the docker group to run Docker commands without sudo.
sudo usermod -aG docker $USERApply the new group membership without rebooting.
newgrp dockerVerify Docker Installation#
Run the following command to verify Docker is working correctly.
docker run hello-worldIf Docker is installed correctly, you will see a confirmation message from the Docker container.
Why Use Docker on Void Linux?#
Docker allows you to:
- Run isolated applications
- Simplify development environments
- Deploy applications consistently
- Manage containers efficiently
Void Linux is lightweight and fast, making it a good choice for containerized workloads.
Troubleshooting#
Docker Command Not Found#
Log out and log back in after adding your user to the Docker group.
Docker Service Not Running#
Check whether the service link exists.
ls -l /var/service/dockerRestart the service if needed.
sudo sv restart dockerConclusion#
You have successfully installed Docker on Void Linux and configured it for everyday use. You can now start running containers and building containerized applications on your system.
For more advanced configuration and usage, visit the official Docker documentation.
