تحميل

How to Install and Setup Docker on Ubuntu

Updated at
22/08/2023
Views
4103

Docker is a popular containerization platform that allows you to build, deploy, and run applications in containers. Here are the steps to install and set up Docker on Ubuntu:

1. Update the package index and install the necessary packages:

```
sudo apt update
sudo apt install apt-transport-https ca-certificates curl gnupg lsb-release
```

2. Add the Docker GPG key:

```
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
```

3. Add the Docker repository to your system:

```
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
```

4. Update the package index again and install Docker:

```
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io
```

5. Verify that Docker is installed and running:

```
sudo systemctl status docker
```

You should see output indicating that Docker is active and running.

6. Add your user to the Docker group:

```
sudo usermod -aG docker your-user
```

Replace "your-user" with your username. This allows you to run Docker commands without using "sudo".

7. Test Docker by running the "hello-world" container:

```
docker run hello-world
```

Docker will download the "hello-world" container image and run it. You should see output indicating that Docker is working correctly.

That's it! You have successfully installed and set up Docker on Ubuntu.

YottaSrc footer

لماذا تختارنا؟

أفضل الأسعار, تخزين SSD سريع و دعم فني
24/7 حقيقي

control panel icon
cPanel

إدارة موقعك من خلال CPanel بأحدث إصدار

security icon
سريع وموثوق وآمن

ضمان وقت تشغيل بنسبة 99.8٪.
لذا ركز على عملك!

support icon
دعم 24/7/365

ليلاً أو نهارًا ، مطر أو شمس ،
فريقنا هنا من أجلك!

cloud backup icon
نسخ احتياطي يومي

نسخ احتياطي يومي وأسبوعي.
ملفاتك آمنة!