How To Install Docker on Fedora 37
In this tutorial, we will show you how to install Docker on Fedora 37. As a powerful and versatile containerization platform, Docker has revolutionized the way software is developed and deployed. Whether you’re a developer, a system administrator, or a DevOps engineer, knowing how to install and use Docker on your system is essential to your success. In this blog post, we will show you step-by-step how to install Docker on Fedora 37, one of the most popular Linux distributions used in enterprise environments. We will also explore some of the most useful Docker commands and show you how to use them to build, run, and manage Docker containers. So, if you’re ready to dive into the world of Docker and take your skills to the next level, read on!
This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo
‘ to the commands to get root privileges. I will show you the step-by-step installation of Docker containers on a Fedora 37.
Prerequisites
- A server running one of the following operating systems: Fedora 37.
- It’s recommended that you use a fresh OS install to prevent any potential issues.
- SSH access to the server (or just open Terminal if you’re on a desktop).
- An active internet connection. You’ll need an internet connection to download the necessary packages and dependencies for Docker.
- A
non-root sudo user
or access to theroot user
. We recommend acting as anon-root sudo user
, however, as you can harm your system if you’re not careful when acting as the root.
Install Docker on Fedora 37
Step 1. Before proceeding, update your Fedora operating system to make sure all existing packages are up to date. Use this command to update the server packages:
sudo dnf upgrade sudo dnf update sudo dnf install dnf-plugins-core
Step 2. Installing Docker on Fedora 37.
By default, Docker is not available on Fedora 37 base repository. Now we run the following command below to add Docker repository to your Fedora system:
sudo dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo
Next, update the package list and install Docker by running the following command:
sudo dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
After the installation is complete, start the Docker service by running the following command:
sudo systemctl start docker sudo systemctl enable docker
To verify that Docker is installed correctly on Fedora 37, run the following command:
sudo docker run hello-world
This command will download a Docker image and run a container that prints a “Hello from Docker!” message. If you see the message, Docker is installed and working correctly.
Step 3. Manage Docker Users.
Now that you have Docker installed and configured on Fedora 37, you may want to manage Docker users. Here are some common tasks:
Add a user to the docker group:
sudo usermod -aG docker username
Remove a user from the docker group:
sudo gpasswd -d username docker
List members of the docker group:
sudo getent group docker
Step 4. Docker Commands.
Docker has many commands that allow you to manage containers, images, and volumes. Here are some common Docker commands:
Command | Description | Example |
---|---|---|
docker ps |
List running containers | docker ps |
docker images |
List all Docker images on the system | docker images |
docker pull |
Download a Docker image from a registry | docker pull ubuntu:latest |
docker run |
Start a new Docker container | docker run -it --name mycontainer ubuntu /bin/bash |
docker stop |
Stop a running Docker container | docker stop mycontainer |
docker rm |
Remove a Docker container | docker rm mycontainer |
docker rmi |
Remove a Docker image | docker rmi ubuntu:latest |
docker build |
Build a Docker image from a Dockerfile | docker build -t myimage . |
docker exec |
Run a command in a running container | docker exec -it mycontainer /bin/bash |
docker logs |
View logs from a container | docker logs mycontainer |
docker inspect |
Display detailed information about a container or image | docker inspect mycontainer |
docker network |
Manage Docker networks | docker network create mynetwork |
docker volume |
Manage Docker volumes | docker volume create myvolume |
Congratulations! You have successfully installed Docker. Thanks for using this tutorial for installing Docker containers on your Fedora 37 system. For additional help or useful information, we recommend you check the official Docker website.