Docker / Engine Post-installation steps for Linux
Hello! Today, we want to talk about the post-installation steps for Docker on Linux operating systems. You might think that everything is done after Docker installation, but in reality, that's not the case! There are several important steps that you need to complete before using Docker. To begin, you need to add your user to the docker group so that for executing Docker commands, you won't have to use sudo.
The first step is to ensure that Docker has been installed correctly after installation. You can use the command docker --version
for this purpose. If everything has been installed correctly, the version of Docker should be displayed. This indicates that you have successfully started the Docker service on your system.
Another important step is to start the Docker service. You can use the command sudo systemctl start docker
to start the service. It is also possible that you want Docker to start automatically upon system boot. For this, use the command sudo systemctl enable docker
.
Now that Docker has been installed and configured, you can use the basic commands! It's good to take a look at Docker's documentation and become more familiar with it. By following these steps, you can effectively use Docker and manage your own containers.
sudo usermod -aG docker $USER
sudo systemctl start docker
sudo systemctl enable docker
docker --version
Code Details
In this code, we explore the main steps to configure Docker:
sudo usermod -aG docker $USER
With this command, the current user is added to the docker group to be able to execute Docker commands without using sudo
.
sudo systemctl start docker
This command starts the Docker service. If Docker is currently not running, this command will start it.
sudo systemctl enable docker
With this command, Docker is configured to start automatically when the system is booted.
docker --version
This command shows the installed version of Docker, which you can use to ensure that the installation process was successful.
<