Setting Up Docker on Linux Apache AGE: A step-by-Step Guide
Tags: docker, installation, postgres
Published: 2023-08-17 20:14:29

In this blog we will look and explore about docker.  How we can install it on linux Operating system and in next blogs we will look at how we can setup our developer environment to run Apache AGE image using docker.


## Introduction

Docker is an open-source plateform for building, scaling, shipping and management of applications inside portable containers. Containers are basically isolated working environemnts that allows user to package their working application along with its required dependencies. And allow them to run it consistently across different devices having different working environemnt. It can be used for various purposes like application isolation, portability, version control,microservices and resource efficiency.

 
## Installation 

There are different ways to install dokcer on linux. You can check all those from docker [official webiste](https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository). In this we will look at one of the easiet way to install.


Before installing docker for the first time on our machine. We need to setup docker repository. And after that we can install and update docker from the repository.

## Step 1

Update the apt packages and install required dependencies.

```
sudo apt-get update
sudo apt-get install ca-certificates curl gnupg
```
## Step 2 

Add docker's official `GPG key`.

```
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

```

## Step 3

Setup docker repository on your machine.

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

## Step 4
Update the apt package index.

```
sudo apt-get update
```

Everything is setup now. We only need to install the latest version of docker.

```
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
```
Command given above may take some time depending upon the network speed. After installation you can us docker.

## Install Check

To check if it is successfully installed or not you can run this command.

```
sudo docker run hello-world
```
**Note** 
If you have any permission error or issues like this one


![pemission issues](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4ck5dnyko39j2uq4u5tz.png)

you need to create an account on [docker hub](https://hub.docker.com/).
After creating an account you can login using terminal.

```
docker login -u your_user_name
```

It will ask for user password that you entered on the time of creation of account on docker hub. Provide that password. It will show login succeeded.

In the next blog we will look at how we can setup and use apache AGE using docker.

## References

(https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository)
[https://blog.idrisolubisi.com/how-to-fix-error-response-from-daemon-pull-access-denied-for-yourusernameyourrepository](https://blog.idrisolubisi.com/how-to-fix-error-response-from-daemon-pull-access-denied-for-yourusernameyourrepository)
[https://www.australtech.net/top-tips-to-install-docker-on-ubuntu-18-04/](https://www.australtech.net/top-tips-to-install-docker-on-ubuntu-18-04/)