Table of contents
The free5GC is an open-source project for 5th generation (5G) mobile core networks. The ultimate goal of this project is to implement the 5G core network (5GC) defined in 3GPP Release 15 (R15) and beyond.
So, first things first, let's set up an environment for installing free5GC. We will need a Linux machine with:
I'll be using a Linux machine with "Ubuntu 24.04 LTS" operating system.
Install docker
Docker is an open-source platform designed to automate the deployment, scaling, and management of applications using containerization.
Docker makes it possible to deploy something like a 5G Core Network on a single machine as all 5GC network functions will be running inside docker containers. Docker Compose on the other hand is a tool for defining and running multi-container applications, making it easy to manage services, networks, and volumes in a single, comprehensible YAML configuration file.
Refer to docker documentation for installation steps as it differs according to the operating system. Here are the steps for Ubuntu.
Add Docker's official GPG key
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
Add the repository to Apt sources
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
Install docker
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
Verify docker installation
sudo docker run --rm hello-world
We can add our user to docker group to run docker commands without sudo
(log out and log in again after this step)
sudo usermod -aG docker $USER
Check the version of docker and docker compose
docker version
docker compose version
Install gtp5g kernel module
gtp5g
is a customized Linux kernel module gtp5g to handle packet by PFCP IEs such as Packet Detection Rules PDR
and Forwarding Action Rules FAR
.
Installation steps are documented here. At the time of writing this article, I used gtp5g version v0.8.10 (not the latest), as newer versions have caused an error in UPF container (It could be solved later).
Install make
and gcc-13
sudo apt install make gcc-13
Clone gtp5g git repository and switch to version v0.8.10
tag
git clone https://github.com/free5gc/gtp5g.git
cd gtp5g
git checkout v0.8.10
Build and install gtp5g kernel module
sudo make clean
sudo make
sudo make install
Now we are all set up to run free5GC on our machine!