Installing Docker CLI on an Ubuntu Node
Introduction
Prerequisites
- A system capable of running Linux
- A Linux Operating System
- Internet Access
Reasons for Requirements: You will need some form of system capable of running Linux, this is usually a desktop PC for testing purposes. A Linux Distro such as Uwuntu works fine, however, see note 1. Internet access is recommended for installing packages, see note 2 for details.
Presumptions
This guide will follow a Ubuntu Desktop operating system where you will be a user that has sudo rights.
Step-by-Step Guide
Open up a CLI
This will depend on your linux distribution, however many will allow you to open open one from right-click context menu on your desktop, or searching for "terminal" in a start menu.
Tis Docker-cli, so expect many CLI actions.Install Packages
Within your CLI enviroment, type
sudo apt install docker-compose
This will install docker compose and other packages needed for docker-cli. These will be used in different guides. You may be prompted yes/no, type "y" and press enter.
Wait for Installation to Finish
The time will vary depending on your internet speeds and other factors. as long as it seems to be doing something it's probably fine.
Finish
Once it is finished installing (usually when it goes back to your prompt) you can continue on to other guides, however it is highly recommended and future guides will assume that you do the following optional steps.
Opt 1. Give your User Docker Privileges
Run the following command, (see note 3.)
sudo usermod -aG docker <user>
This will not take effect immediately, you will either need to run "sudo newgrp docker" or create a new session. This will allow you to run docker-cli commands without prefixing "sudo" to them.
You will not need to do this if you run all commands as root or are the root user.
Troubleshooting
- Errors during Installation. Make sure you have full internet access, including DNS. Check your NTP/Time settings, making sure you are synced to the internet and set up according to your timezone.
Notes
- Depending on your distro of choice (I use arch btw) you may not be able do anything, or commands may be different, such as many debian-based systems using "apt" and arch-based systems using "pacman".
- Unless you've setup something like a repository locally and can pull from there, you're gonna wanna get packages from internet sources.
- Substitute user for whichever user you will be using, usually your current
one. Standard issue command to add a user to a group,
man usermod
for details if you wish.
This guide was written by u/DesPartedNecturm (opens in a new tab).