# Install free5gc using docker compose

After installing the prerequisites (docker and gtp5g), we are ready to install and run free5gc containers using Docker Compose.

Docker compose simplifies and automates multi-container application deployment using a single docker compose YAML file that contains all related information about the containers to be deployed. So let's get started.

Clone git repository of [free5gc-compose](https://github.com/free5gc/free5gc-compose) and change directory `cd` to `free5gc-compose` directory.

```bash
git clone https://github.com/free5gc/free5gc-compose.git
cd free5gc-compose
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1724330819476/6aaae769-a6bf-4e0a-9f59-c43023a4ba8e.png align="left")

It is recommended to use `git checkout` to switch to a specific [release version](https://github.com/free5gc/free5gc-compose/releases) (latest) as there are continuous changes being implemented which might cause some errors during deployment. In the time of writing this article, latest release version is `v3.4.2`.

```bash
git checkout v3.4.2
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1724332165801/fb1c48fa-7011-42d3-9303-46c792a3fb7d.png align="center")

If you list the contents of `free5gc-compose` directory, you will find a `docker-compose.yaml` file which will be used to install and run all free5gc containers. In addition to some other files and directories that we might refer to it later while testing.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1724330999201/dc8ec426-45b8-4676-aedb-b4559a6cad89.png align="center")

Let's now create and run free5gc containers using docker compose. Run the following command inside `free5gc-compose` directory.

```bash
docker compose up -d
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1724332294655/8896fdc7-5172-47e2-bfb0-d62b3c4d275f.png align="center")

The command output is showing free5gc containers being created and started including:

* A database container (mongodb).
    
* 5GC network functions containers (UPF, NRF, NSSF, UDM, SMF, AUSF, UDR, AMF, PCF, CHF and N3IWF).
    
* A WebUI container to manage subscribers data via GUI.
    
* UE and RAN simulation containers for testing purposes (UERANSIM and N3IWUE).
    

Let's ensure that the containers are up and running by running the following command

```bash
docker compose ps
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1724333378270/17cad31a-3571-4ed6-8e9f-b4ac435de5c5.png align="center")

And that's it! We have a fully 5G core network running in our machine.

In the next article, we will run our first 5G test ...
