Installing Forem/Dev using Docker on Ubuntu
Tags: selfhosting, opensource, tutorial
Published: 2020-08-20 08:52:12

Setting up Forem using Docker is one of the easiest ways to have Development Instance 😇. If you already have **Docker** and **Docker-Compose**, you can install a development instance with a single command, but you guys, you don't deserve the fun 😏 => You can check out the last section of this post and find the **Golden Command**

---

For the rest, let us do it but with fun 🥳🥳. Do you remember this song? One Kiss? 👶 Which made Dua Lipa, the Dua Lipa?

*One command is all it takes 
fallin' love with Forem
Possibilities
I look Like all you need*

![One Kiss Lyrics](https://dev-to-uploads.s3.amazonaws.com/i/g5qluo1998cea0wke0t2.jpg)

Fortunately, if you never installed Docker or Docker-Compose, don't worry 😵, I'm here for you. Open Youtube in the new tab and play this "**One Kiss 💋 by Dua Lipa**" in the background and copy-paste my commands.

---

> # Installing Docker using Repository

---

All the commands are from the official documentation of Docker itself, so don't worry, just copy-paste. In case if you don't believe me 🤔, [click here](https://docs.docker.com/engine/install/ubuntu/), this will redirect you to the official documentation.

* Updating and Installing some necessaries

```
sudo apt-get update
```
```
sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg-agent \
    software-properties-common
```

* Adding Docker’s official GPG key

```
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
```
* Setting up the stable repository

```
sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"
```

* Updating and Installing Docker Engine

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

* Testing the Docker Installation

```
sudo docker run hello-world
```
This command downloads a test image and runs it in a container. When the container runs, it prints an informational message and exits.

With this our Docker installation was done 😁, now let's turn up towards the Docker-Compose Installation 💪.

In case, you are facing any errors!☠️ [Click Here](https://docs.docker.com/engine/install/), choose your OS and follow the official instructions 💩.

---

> # Installing Docker Compose

---

As I mentioned earlier, I am following the official documentation, so you can copy and paste. In case, if you want to follow them by yourself 😒😤, [click here](https://docs.docker.com/compose/install/)

* Downloading the current stable Docker Compose

```
sudo curl -L "https://github.com/docker/compose/releases/download/1.26.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
```

* Giving executable permissions to the binary

```
sudo chmod +x /usr/local/bin/docker-compose
```

* Verifying the Installation

```
docker-compose --version
```

For some unknown reason, if you end up with an error🧐 try repeating the docker-compose installation only. If the error persisted, I would suggest you reinstall your OS 🤒. You should not get an error😤.

---

> # Time to change the Beat

---

Enough of **One Kiss**. Time for some awesome beats, check this out **Strobe** by **Deabmau5** => [Youtube link to Strobe](https://www.youtube.com/watch?v=tKi9Z-f6qX4)

Now we have Docker and Docker Compose installed in our local machine, but there is one more thing left for us to do 😳. We forget to **fork** and **download** the Forem code into our local machine from the GitHub 🤯.

I knew the response of many of you would be 🤬, but bare with me 👻.

---

> # Forking and Downloading the Forem code

---

Don't make me repeat it again 😠, play the **Strobe** by **Deadmau5** in the background 🤗. I knew you can't make a coffee whenever you have to wait for some time, here, the Docker can consume enough time to bore you up.


* Fork the repository from the Github

```
Better do it by using Github website, don't copy and paste this -_-
```
Link to the repository to fork: [click here](https://github.com/forem/forem/fork)

* Downloading the repository to you local machine

```
git clone https://github.com/<your-username>/forem.git
```
Dude, please change the **your-username** to your own Github username, or else you can 🤮 on your experience 🥺.

* Enter into the downloaded Forem folder

```
cd forem
```
---

> # The awaited Golden Command

---

🥵🥵🥵 You did nothing, but yeah, I assume you are horrified by the way I demonstrate this 🥶

* Running Forem with Docker Via Docker-Compose

```
bin/container-setup
```
This command will do its job, you just keep an eye on the terminal by listening to **strobe** 🤭🤭. You will really appreciate the work done by the team Forem, they really made it easy for us (non-developers), but sure you can call yourself a DEV after this.

* That's it! Navigate to http://localhost:3000

--- 

Any improvements 👨‍🔬, suggestions 🤦‍♂️, and issues ☠️ are welcomed in the comment section. This is not formal documentation for me to shy out, load them out, and let us change it according to our needs.

With this, we have our own **Development Instance**. I will catch you in the next post 👨‍💻 👩‍💻 (Devs), possibly with something similar to this but in a different environment.