Skip to main content

Setup your server

Learn how to setup server and deploy to start using it. Hero Light

Get Licence

Get license and necessary files to get started. Contact us
The following steps must be executed at every location. If you plan to send and receive data across multiple locations, ensure that each location performs these steps independently, as each location will have its own MongoDB server.

Install MongoDB Community Edition

To manage data transfer and users, you need to install the Mongodb server on your system, using the default port 27017.

Reverse Proxy (Optional)

If you wish to set up a reverse proxy for your setup, follow the steps below to configure Nginx as the reverse proxy server.

1. Install Nginx

bash
sudo apt update
sudo apt install nginx

2. Configure Nginx

Create or edit a configuration file in /etc/nginx/sites-available/ and link it to the sites-enabled directory.
bash
sudo nano /etc/nginx/sites-available/reverse-proxy.conf
Add the following configuration, replacing localhost:80 with the local port and ip.provided.by.us:port with the target IP and port:
nginx
server {
    listen 80;
    server_name localhost;

    location / {
        proxy_pass http://{license_ip}:{license_port};
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}
Enable the configuration by linking the file:
bash
sudo ln -s /etc/nginx/sites-available/reverse-proxy.conf /etc/nginx/sites-enabled/

4. Restart Nginx:

bash
sudo systemctl restart nginx

Setup Daemon server

Run daemon.bin as system daemon service
  1. Make the script executable:
sudo chmod +x /opt/zetarya/daemon.bin
  1. Before running it as a daemon, execute bin file manually for the first time. This will prompt you to enter the license IP address provided by us and the name of the current location.
sudo /opt/zetarya/daemon.bin
  1. Create the service file: You’ll create a service file for the zetarya service in the /etc/systemd/system/ directory.
sudo nano /etc/systemd/system/zetarya.service
  1. Define the service: Add the following content to the service file:
[Unit]
Description=Zetarya Daemon Service
After=network.target

[Service]
ExecStart=/etc/daemon.bin
Restart=on-failure
User=nobody
Group=nogroup
Environment=ENV_VAR=example_value
WorkingDirectory=/etc

[Install]
WantedBy=multi-user.target

  1. Reload the systemd daemon: This step makes systemd aware of the new service.
sudo systemctl daemon-reload
sudo systemctl enable zetarya.service
sudo systemctl start zetarya.service
Repeat above process on both sending and receiving side except reverse proxy