{"id":164041,"date":"2025-04-07T20:20:38","date_gmt":"2025-04-07T20:20:38","guid":{"rendered":"https:\/\/linuxiac.com\/?p=164041"},"modified":"2025-04-07T20:29:31","modified_gmt":"2025-04-07T20:29:31","slug":"how-to-install-docker-on-void-linux","status":"publish","type":"post","link":"https:\/\/linuxiac.com\/how-to-install-docker-on-void-linux\/","title":{"rendered":"How to Install Docker on Void Linux: A Step-by-Step Guide"},"content":{"rendered":"\n<p><a href=\"https:\/\/linuxiac.com\/void-linux\/\">Void Linux<\/a> is a systemd-free, rolling-release distribution with a strong UNIX vibe. It&#8217;s one of the rare, truly original distros\u2014built from scratch rather than based on another project\u2014and it\u2019s earned a loyal following, especially among more experienced Linux users.<\/p>\n\n\n\n<p><a href=\"https:\/\/linuxiac.com\/archlinux\/\">Much like Arch<\/a>, Void gives you full control to tweak every aspect to fit your needs and understanding, making it a great developer environment. And when we talk about development, we can&#8217;t help but mention containerization, specifically Docker.<\/p>\n\n\n\n<p>While many Linux distributions offer straightforward Docker installation methods, Void Linux\u2014known for its simplicity, speed, and runit-based init system\u2014requires a slightly different approach. But don&#8217;t worry, because you&#8217;ve come to the right place.<\/p>\n\n\n\n<p>Whether you&#8217;re new to Void or a seasoned Linux user looking to leverage Docker&#8217;s power, I&#8217;ll walk you through the installation process step by step in this guide. In just a few minutes, you&#8217;ll have Docker up and running smoothly on your Void system, ready to build, ship, and easily run your containers.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Install Docker on Void Linux<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Refresh the Package Base<\/h3>\n\n\n\n<p>First, let\u2019s refresh the package base on our Void system to make sure we\u2019re using the latest versions of the software available in the distro\u2019s repos.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"Bash\" data-shcb-language-slug=\"bash\"><span><code class=\"hljs language-bash\">sudo xbps-install -Su<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Bash<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">bash<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2025\/04\/void-docker-01.jpg\"><img decoding=\"async\" width=\"1018\" height=\"95\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2025\/04\/void-docker-01.jpg\" alt=\"Refreshing the package base.\" class=\"wp-image-164089\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2025\/04\/void-docker-01.jpg 1018w, https:\/\/linuxiac.com\/wp-content\/uploads\/2025\/04\/void-docker-01-380x35.jpg 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2025\/04\/void-docker-01-768x72.jpg 768w\" sizes=\"(max-width: 1018px) 100vw, 1018px\" \/><\/a><figcaption class=\"wp-element-caption\">Refreshing the package base.<\/figcaption><\/figure>\n\n\n\n<p>Make sure there aren\u2019t any packages waiting to be updated. If there are, just hang tight and let them finish installing first.<\/p>\n\n\n\n<p>If you\u2019re unsure about using Void\u2019s XBPS package manager, I highly recommend checking out our guide, &#8220;<a href=\"https:\/\/linuxiac.com\/void-linux-xbps-package-manager\/\">How to Use the XBPS Package Manager on Void Linux<\/a>.&#8221; It\u2019s a great resource that\u2019ll have you feeling confident in no time. Now, back to the topic.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: Install Docker<\/h3>\n\n\n\n<p>Now we can go ahead and install Docker itself\u2014it&#8217;s available right from the official Void repositories. All you need to do is install the &#8220;<em>docker<\/em>&#8221; package, which will automatically pull in all the dependencies it needs to run smoothly.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"Bash\" data-shcb-language-slug=\"bash\"><span><code class=\"hljs language-bash\">sudo xbps-install -S docker<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Bash<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">bash<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2025\/04\/void-docker-02.jpg\"><img decoding=\"async\" width=\"1024\" height=\"731\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2025\/04\/void-docker-02-1024x731.jpg\" alt=\"Install Docker on Void Linux\" class=\"wp-image-164104\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2025\/04\/void-docker-02-1024x731.jpg 1024w, https:\/\/linuxiac.com\/wp-content\/uploads\/2025\/04\/void-docker-02-380x271.jpg 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2025\/04\/void-docker-02-768x549.jpg 768w, https:\/\/linuxiac.com\/wp-content\/uploads\/2025\/04\/void-docker-02.jpg 1078w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Install Docker on Void Linux<\/figcaption><\/figure>\n\n\n\n<p>This installs the following main Docker components:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>docker<\/strong>: The Docker engine itself.<\/li>\n\n\n\n<li><strong>docker-cli<\/strong>: A command line tool that lets you talk to the Docker daemon.<\/li>\n\n\n\n<li><strong>containerd<\/strong>: A container runtime that manages the container\u2019s lifecycle.<\/li>\n<\/ul>\n\n\n\n<p>That\u2019s all! Docker should now be installed. However, before it can work, we must enable and start the Docker service. But as we mentioned at the beginning, Void Linux doesn\u2019t use systemd\u2014it&#8217;s a <a href=\"https:\/\/linuxiac.com\/best-systemd-free-linux-distributions\/\" data-type=\"post\" data-id=\"48136\">systemd-free distro<\/a>\u2014so things work a bit differently here.<\/p>\n\n\n\n<p>Instead of systemd, Void relies on <a href=\"https:\/\/smarden.org\/runit\/\" target=\"_blank\" rel=\"noreferrer noopener\">runit<\/a> to manage services &#8211; a simple and lightweight init and service management daemon. To enable and start the Docker service, we use:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"Bash\" data-shcb-language-slug=\"bash\"><span><code class=\"hljs language-bash\">sudo ln -s \/etc\/sv\/docker \/var\/service<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Bash<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">bash<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Now, let&#8217;s check the service status. Here, we can&#8217;t just run <code>systemctl status docker<\/code>, because&#8230; well, there&#8217;s no such thing here. Instead, we rely on the service management tools provided by runit\u2014specifically, the <code>sv<\/code> command.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"Bash\" data-shcb-language-slug=\"bash\"><span><code class=\"hljs language-bash\">sudo sv status docker<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Bash<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">bash<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2025\/04\/void-docker-03.jpg\"><img decoding=\"async\" width=\"914\" height=\"124\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2025\/04\/void-docker-03.jpg\" alt=\"Check the status of the Docker service in Void Linux.\" class=\"wp-image-164116\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2025\/04\/void-docker-03.jpg 914w, https:\/\/linuxiac.com\/wp-content\/uploads\/2025\/04\/void-docker-03-380x52.jpg 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2025\/04\/void-docker-03-768x104.jpg 768w\" sizes=\"(max-width: 914px) 100vw, 914px\" \/><\/a><figcaption class=\"wp-element-caption\">Check the status of the Docker service in Void Linux.<\/figcaption><\/figure>\n\n\n\n<p>As you can see from the command output, the Docker service is running and will start automatically every time the system boots.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3: Verify Installation<\/h3>\n\n\n\n<p>The moment of truth. Let\u2019s check if our new Docker installation works correctly by running a simple containerized application called \u201c<em>hello-world<\/em>.\u201d<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"Bash\" data-shcb-language-slug=\"bash\"><span><code class=\"hljs language-bash\">sudo docker run hello-world<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Bash<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">bash<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2025\/04\/void-docker-04.jpg\"><img decoding=\"async\" width=\"998\" height=\"744\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2025\/04\/void-docker-04.jpg\" alt=\"Docker successfully installed, up &amp; running on Void Linux.\" class=\"wp-image-164125\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2025\/04\/void-docker-04.jpg 998w, https:\/\/linuxiac.com\/wp-content\/uploads\/2025\/04\/void-docker-04-380x283.jpg 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2025\/04\/void-docker-04-768x573.jpg 768w\" sizes=\"(max-width: 998px) 100vw, 998px\" \/><\/a><figcaption class=\"wp-element-caption\">Docker successfully installed, up &amp; running on Void Linux.<\/figcaption><\/figure>\n\n\n\n<p>Congratulations! As we can see, everything works as expected.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Enabling Non-root Users to Run Docker Commands<\/h2>\n\n\n\n<p>We have successfully installed Docker on our Void Linux system so far. However, by default, only root and users with sudo privileges can execute Docker commands.<\/p>\n\n\n\n<p>In other words, if you attempt to run the&nbsp;<code>docker<\/code>&nbsp;command without prefixing it with&nbsp;<code>sudo<\/code>, you\u2019ll get an error message like this:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2025\/04\/void-docker-05.jpg\"><img decoding=\"async\" width=\"1024\" height=\"143\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2025\/04\/void-docker-05-1024x143.jpg\" alt=\"Docker permission denied.\" class=\"wp-image-164128\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2025\/04\/void-docker-05-1024x143.jpg 1024w, https:\/\/linuxiac.com\/wp-content\/uploads\/2025\/04\/void-docker-05-380x53.jpg 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2025\/04\/void-docker-05-768x107.jpg 768w, https:\/\/linuxiac.com\/wp-content\/uploads\/2025\/04\/void-docker-05.jpg 1045w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Docker permission denied.<\/figcaption><\/figure>\n\n\n\n<p>But there is no room for worries. To run Docker commands as a non-root user, you must first add your user to the \u201c<em>docker<\/em>\u201d group. It is a simple task. To do that, type in the following:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"Bash\" data-shcb-language-slug=\"bash\"><span><code class=\"hljs language-bash\">sudo usermod -aG docker <span class=\"hljs-variable\">${USER}<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Bash<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">bash<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>In the above command,&nbsp;\u201c<em>${USER}<\/em>\u201d&nbsp;is a&nbsp;system environment variable&nbsp;that contains your username. Then, run the following command to activate the changes to the group:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"Bash\" data-shcb-language-slug=\"bash\"><span><code class=\"hljs language-bash\">newgrp docker<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Bash<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">bash<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>You can then execute <code>docker<\/code> commands without prefixing them with <code>sudo<\/code>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2025\/04\/void-docker-06.jpg\"><img decoding=\"async\" width=\"991\" height=\"146\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2025\/04\/void-docker-06.jpg\" alt=\"Run the docker command as a regular user.\" class=\"wp-image-164131\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2025\/04\/void-docker-06.jpg 991w, https:\/\/linuxiac.com\/wp-content\/uploads\/2025\/04\/void-docker-06-380x56.jpg 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2025\/04\/void-docker-06-768x113.jpg 768w\" sizes=\"(max-width: 991px) 100vw, 991px\" \/><\/a><figcaption class=\"wp-element-caption\">Run the docker command as a regular user.<\/figcaption><\/figure>\n\n\n\n<p>Remember that this solution will work only for your current terminal session. In other words, if you close the terminal, you will either have to execute the <code>newgrp<\/code> command above again or prefix <code>docker<\/code> commands with <code>sudo<\/code>. To make this change last permanently, restart your Void system.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>As you can see, installing Docker on Void Linux is actually pretty straightforward. Following the steps in this guide, you should have everything up and running in just 10 to 15 minutes\u2014ready to jump right into your containerized projects.<\/p>\n\n\n\n<p>To learn more about Docker, check out its official\u00a0<a href=\"https:\/\/docs.docker.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">documentation<\/a>. Additionally, if you encounter any other difficulties, you can always consult <a href=\"https:\/\/docs.voidlinux.org\/\" target=\"_blank\" rel=\"noopener\">the excellent documentation<\/a> provided by the Void developers\u2014it&#8217;s a great resource.<\/p>\n\n\n\n<p>That was all from me. If you have any questions, let me know in the comments section below. Thank you for following this tutorial, and happy Dockerizing!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Learn how to install Docker on Void Linux and get this containerization platform up and running smoothly on your Void system in minutes.<\/p>\n","protected":false},"author":10,"featured_media":164044,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,4417],"tags":[5233,1439,3410],"class_list":["post-164041","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","category-linux-knowledge","tag-containerization","tag-docker","tag-void"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/linuxiac.com\/wp-json\/wp\/v2\/posts\/164041","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxiac.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxiac.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxiac.com\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxiac.com\/wp-json\/wp\/v2\/comments?post=164041"}],"version-history":[{"count":0,"href":"https:\/\/linuxiac.com\/wp-json\/wp\/v2\/posts\/164041\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxiac.com\/wp-json\/wp\/v2\/media\/164044"}],"wp:attachment":[{"href":"https:\/\/linuxiac.com\/wp-json\/wp\/v2\/media?parent=164041"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxiac.com\/wp-json\/wp\/v2\/categories?post=164041"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxiac.com\/wp-json\/wp\/v2\/tags?post=164041"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}