# Updating the Cloud Instance and Getting Docker

Once inside of the instance, can now run these commands one by one:

```bash
sudo apt-get update
sudo apt-get install ca-certificates curl gnupg

sudo install -m 0755 -d /etc/apt/keyrings

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg

sudo chmod a+r /etc/apt/keyrings/docker.gpg


```

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

```bash
sudo apt-get update -y
```

<figure><img src="https://2022164620-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtzurpgroDJSMn9AFVmQP%2Fuploads%2FlWRCOHlwYcckLcdrghqG%2Fimage.png?alt=media&#x26;token=e3331da3-9ea4-4adf-936c-aa97f0be10c7" alt=""><figcaption></figcaption></figure>

```sh
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
```

\


<figure><img src="https://2022164620-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtzurpgroDJSMn9AFVmQP%2Fuploads%2F8kp8WpgWvujXOwsyxGeV%2Fimage.png?alt=media&#x26;token=4d5dce6e-ffc5-465b-9d72-981dd61ca7a8" alt=""><figcaption></figcaption></figure>

```sh
sudo apt install docker-compose
```

<figure><img src="https://2022164620-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtzurpgroDJSMn9AFVmQP%2Fuploads%2FBjsYiWAH9Lwehd2ddmUu%2Fimage.png?alt=media&#x26;token=de448815-44bf-4f26-a43b-5986f67df713" alt=""><figcaption></figcaption></figure>

Now for the following commands

```sh
sudo service docker restart

sudo usermod -aG docker $USER

sudo newgrp docker

sudo chmod 666 /var/run/docker.sock

sudo systemctl restart docker 
```

<figure><img src="https://2022164620-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtzurpgroDJSMn9AFVmQP%2Fuploads%2Fafz5QvOCapt1tyZCnuZL%2Fimage.png?alt=media&#x26;token=680c5ec9-c009-4da8-8d94-3220ca64b84f" alt=""><figcaption></figcaption></figure>





















