Skip to content

0 compose

free5GC compose is a docker compose version of free5GC for stage 3. It's inspired by free5gc-docker-compose and also reference to docker-free5gc.


Note: AVX for MongoDB: some HW does not support MongoDB releases above4.4 due to use of the new AVX instructions set. To verify if your CPU is compatible you can check CPU flags by running grep avx /proc/cpuinfo. A workaround is suggested here.

Start free5GC

Because we need to create tunnel interface, we need to use privileged container with root permission.

Pull docker images from Docker Hub

docker compose pull

[Optional] Build docker images from local sources

# Clone the project
git clone
cd free5gc-compose

# clone free5gc sources
cd base
git clone --recursive -j `nproc`
cd ..

# Build the images
make all
docker compose -f docker-compose-build.yaml build

# Alternatively you can build specific NF image e.g.:
make amf
docker compose -f docker-compose-build.yaml build free5gc-amf


Dangling images may be created during the build process. It is advised to remove them from time to time to free up disk space.

docker rmi $(docker images -f "dangling=true" -q)

Run free5GC

You can create free5GC containers based on local images or docker hub images:

# use local images
docker compose -f docker-compose-build.yaml up
# use images from docker hub
docker compose up # add -d to run in background mode

Destroy the established container resource after testing:

# Remove established containers (local images)
docker compose -f docker-compose-build.yaml rm
# Remove established containers (remote images)
docker compose rm


Sometimes, you need to drop data from DB:

docker exec -it mongodb mongo
> use free5gc
> db.dropDatabase()
> exit # (Or Ctrl-D)

You can see logs for each service using docker logs command. For example, to access the logs of the SMF you can use:

docker logs smf

Please refer to the wiki for more troubleshooting information.

Integration with external gNB/UE simulators

The integration with the UERANSIM eNB/UE simulator is documented here.

You can also refer to this issue to find out how you can configure the UPF to forward traffic between the UERANSIM to the DN (eg. internet) in a docker environment.

This issue provides detailed steps that might be useful.

Integration of WebUI with Nginx reverse proxy

Here you can find helpful guidelines on the integration of Nginx reverse proxy to set it in front of the WebUI:

Vagrant Box Option

For Linux kernel version below 5.4 you can setup a working environment using a vagrant box:
Please refer to GTP5G kernel module for more information.

ULCL Configuration

You can check the following informations below:

[Optional] Run N3IWUE

If you want use N3IWUE, you need to open your web browser from your host machine, and enter the URL http://localhost:5000

  • On the login page, enter username admin and password free5gc.
  • Once logged in, widen the page until you see “Subscribers” on the left-hand side column.
  • Click on the Subscribers tab and then on the New Subscriber button
    • Scroll down to Operator Code Type and change it from "OPc" to "OP".
    • Make sure the following config between free5gc-compose/config/n3uecfg.yaml and Subscriber you create are the same:
      • PLMNID (ex. 208930000001234)
      • K
      • SQN
      • OP value (choose OP instead of OPC)
    • Scroll all the way down and click on Submit.

Then you can access the N3IWUE container and run N3IWUE using the following commands:

# access N3IWUE bash
docker exec -it n3iwue bash

# run N3IWUE