Setup GenieACS under Ubuntu24.04



This content originally appeared on DEV Community and was authored by chenchih

Setup GenieACS

There are many setup tutorial on setup genieacs on internet, however some of them use 20.04 ubuntu version. I like to show using 22.04 on some setting, some of the configure are different, especailly with the mangodb and genieacs configure.

Environment

HW: Raspeberry PI5
OS: ubuntu 24.04 ARM

Check Ubuntu Version

lsb_release -a

  • Check Kernel
uname -ar

Check HW

  • check model
cat /proc/device-tree/model
#or
cat /proc/cpuinfo | grep 'Model'
  • Check CPU type
lscpu

Setup

1. Install node.js

curl -sL https://deb.nodesource.com/setup_14.x -o nodesource_setup.sh
sudo bash nodesource_setup.sh
sudo apt install nodejs
node -v

2. Install MongoDB

Note: In ubuntu 24.04 the ssl default use libssl3, so you don’t need to install. I mention it here because many tutorial mention install libssl, if you install will encouter error.

Check your ssl:

dpkg -l | grep libssl3

2.1 Import the MongoDB GPG Key

sudo apt update sudo apt install gnupg curl -y curl -fsSL https://www.mongodb.org/static/pgp/server-8.0.asc | \ sudo gpg -o /usr/share/keyrings/mongodb-server-8.0.gpg \ --dearmor

2.2 Add the MongoDB Repository

echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-8.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/8.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-8.0.list
sudo apt update

2.3 Install MongoDB

sudo apt install -y mongodb-org

2.4 Start and Enable the MongoDB Service

sudo systemctl start mongod 
sudo systemctl enable mongod 
sudo systemctl status mongod

3. Install GenieACS

You can refer genieacs offical site for more detail

sudo apt update
sudo apt install nodejs npm

sudo npm install -g genieacs@1.2.13
sudo useradd --system --no-create-home --user-group genieacs

mkdir /opt/genieacs
mkdir /opt/genieacs/ext
chown genieacs:genieacs /opt/genieacs/ext

4. genieacs setting

4.1 modify genieacs.env

vi /opt/genieacs/genieacs.env

GENIEACS_CWMP_ACCESS_LOG_FILE=/var/log/genieacs/genieacs-cwmp-access.log
GENIEACS_NBI_ACCESS_LOG_FILE=/var/log/genieacs/genieacs-nbi-access.log
GENIEACS_FS_ACCESS_LOG_FILE=/var/log/genieacs/genieacs-fs-access.log
GENIEACS_UI_ACCESS_LOG_FILE=/var/log/genieacs/genieacs-ui-access.log
GENIEACS_DEBUG_FILE=/var/log/genieacs/genieacs-debug.yaml
NODE_OPTIONS=--enable-source-maps
GENIEACS_EXT_DIR=/opt/genieacs/ext

4.2 Set file ownership and permissions:

sudo chown genieacs:genieacs /opt/genieacs/genieacs.env
sudo chmod 600 /opt/genieacs/genieacs.env

4.3 adding jwt secret

node -e "console.log(\"GENIEACS_UI_JWT_SECRET=\" + require('crypto').randomBytes(128).toString('hex'))" >> /opt/genieacs/genieacs.env

If you don’t add this one will occur error when access genieacs url like below:

4.4 Create logs directory

mkdir /var/log/genieacs
chown genieacs:genieacs /var/log/genieacs

4.5 Create systemd unit files

4.5.1 Run the following command to create genieacs-cwmp service

you can use the which genieacs-cwmp to check the location and paste in below ExecStart option.

sudo systemctl edit --force --full genieacs-cwmp

[Unit]
Description=GenieACS CWMP
After=network.target

[Service]
User=genieacs
EnvironmentFile=/opt/genieacs/genieacs.env
ExecStart=/usr/bin/genieacs-cwmp

[Install]
WantedBy=default.target

4.5.2 Run the following command to create genieacs-nbi service

you can use the which genieacs-nbi to check the location and paste in below ExecStart option.

sudo systemctl edit --force --full genieacs-nbi

[Unit]
Description=GenieACS NBI
After=network.target

[Service]
User=genieacs
EnvironmentFile=/opt/genieacs/genieacs.env
ExecStart=/usr/bin/genieacs-nbi
ExecStart=/usr/local/bin/genieacs-nbi

[Install]
WantedBy=default.target

4.5.3 Run the following command to create genieacs-fs service
you can use the which genieacs-fs to check the location and paste in below ExecStart option.

sudo systemctl edit --force --full genieacs-fs

[Unit]
Description=GenieACS FS
After=network.target

[Service]
User=genieacs
EnvironmentFile=/opt/genieacs/genieacs.env
ExecStart =/usr/local/bin/genieacs-fs

[Install]
WantedBy=default.target

4.5.4 Run the following command to create genieacs-ui service:

you can use the which genieacs-ui to check the location and paste ExecStart

sudo systemctl edit --force --full genieacs-ui

[Unit]
Description=GenieACS UI
After=network.target

[Service]
User=genieacs
EnvironmentFile=/opt/genieacs/genieacs.env
ExecStart=/usr/local/bin/genieacs-ui 

[Install]
WantedBy=default.target

4.5.5 configure log file rotation using logrotate

nano /etc/logrotate.d/genieacs

/var/log/genieacs/*.log /var/log/genieacs/*.yaml {
    daily
    rotate 30
    compress
    delaycompress
    dateext
}

4.5.6 Enable and start services

sudo systemctl enable genieacs-cwmp
sudo systemctl start genieacs-cwmp
sudo systemctl status genieacs-cwmp

sudo systemctl enable genieacs-nbi
sudo systemctl start genieacs-nbi
sudo systemctl status genieacs-nbi

sudo systemctl enable genieacs-fs
sudo systemctl start genieacs-fs
sudo systemctl status genieacs-fs

sudo systemctl enable genieacs-ui
sudo systemctl start genieacs-ui
sudo systemctl status genieacs-ui

It should be running all 4 services.

4.5.7 access to the geniacs http://IPaddress:3000

You can use this command to check host or IP: hostname -I or ip a

If you want your cpe to connect to genieacs your url must add port 7547

http://genieIPADD:7547

It should work now, and look like below

Summary

It should have a great understand on how to setup geniacs server, an easy way. I have been encouter many issue especially with libssl and mogobdb on differeent Ubuntu version. I literally have figure out what causes the problem, the version not support.

Lastly thanks for reading my post.


This content originally appeared on DEV Community and was authored by chenchih