## Installation instructions ### Ubuntu Let's suppose we're installing on a fresh Ubuntu system. First, let's get the code: ``` $ cd /srv/ $ sudo git clone https://github.com/lowercasename/gathio/ ``` We'll need to install npm for this: ``` $ sudo apt update $ sudo apt install npm ``` Now, we'll install the node dependencies: ``` $ cd gathio $ sudo npm install ``` Let's copy the config files in place: ``` $ sudo mv config/api-example.js config/api.js $ sudo mv config/database-example.js config/database.js ``` We can edit them if needed: ``` $ sudo $EDITOR config/api.js $ sudo $EDITOR config/database.js ``` Either way, we'll need to have MongoDB running: ``` $ sudo apt install mongodb $ sudo systemctl start mongodb $ sudo systemctl enable mongodb ``` Next, let's create a dedicated user: ``` $ sudo adduser --home /srv/gathio --disabled-login gathio $ sudo chown -R gathio:gathio /srv/gathio ``` Next, we'll copy the systemd service and reload systemd ``` $ sudo cp config/gathio.service /etc/systemd/system/ $ sudo systemctl daemon-reload ``` Finally, we can start gathio: ``` $ sudo systemctl start gathio ``` It should now be listening on port 3000: ``` $ sudo netstat -tunap | grep LISTEN [...] tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 952/sshd tcp6 0 0 :::3000 :::* LISTEN 5655/node [...] ``` (this doesn't mean it's only listening on IPv6, because sockets under Linux are dual-stack by default...) It is now available on port 3000, and we can continue by setting up a reverse proxy, which allows us to make it available on another port, or from another server; and to enable TLS on the connection(see for example [Linode's guide on the subject](https://www.linode.com/docs/web-servers/nginx/use-nginx-reverse-proxy/#configure-nginx))