---
tags: EmPOWER
---
# Build EmPOWER Controller
## Install Docker
```shell=
sudo apt install -y docker.io
sudo systemctl start docker
sudo systemctl enable docker
```
## Install controller
- Create Docker DB
```shell=
mkdir -p ~/Docker/mongodb
mkdir -p ~/Docker/influxdb
mkdir -p ~/Docker/grafana
sudo docker run -d --restart always -p 27017:27017 --name=mongo -v ~/Docker/mongodb:/data/db mongo
sudo docker run -d --restart always -p 8086:8086 --name=influxdb -v ~/Docker/influxdb:/var/lib/influxdb influxdb:1.8
sudo docker run -d --restart always -p 3000:3000 --name=grafana --user 1000:1000 -v ~/Docker/grafana:/var/lib/grafana grafana/grafana
```
- Clone the empower controller repository
Assume that `$TOPDIR` is `/home/empower/empower-runtime`
```shell=
git clone https://github.com/5g-empower/empower-runtime.git
sudo ln -sf $TOPDIR/conf/ /etc/empower
sudo mkdir -p /var/www/
sudo ln -s $TOPDIR/webui/ /var/www/empower
```
- Connect to controller web UI
At the directory `empower-runtime`, run `./empower-runtime.py`, then the controller web interface can be reached at http://<controller IP>:8888/

- Management of empower folders
Building empower system contains many empower folders, it is suggested to make a folder `workspace` at home directory and put in files that may be modified, e.g. application files in `empower-runtime/`.
Note that the two link files may need to be reconstructed.
## Project Management
- Create Project
Log in as root. Enter the project description and its SSID. The SSID will become the Wi-Fi name.
- Add WTP
Log in as root. In the menu, choose `Devices->WTPs` then Add WTP. Enter the WTP's MAC address and its description.
- Add STA
Log in as user. Choose the project just created by clicking the green flag mark. In the menu, choose `$PROJECT_NAME` then Add Station. Enter the STA's MAC address and its description. Then the STA should be able to connect the network.
- STA handover
Log in as user. In the menu, choose `Clients->LVAPs`. Here we can manage which STA connect to which WTP. We can also handover STA to other WTP under the same project.
## Reference
[How to Install Docker On Ubuntu 18.04](https://phoenixnap.com/kb/how-to-install-docker-on-ubuntu-18-04)