Add the Node.js repo with this guide.
APT:
apt install mariadb-server ruby ruby-dev nodejs git build-essential
GEM:
gem install bundler procodile
Run the secure installation wizard
mysql_secure_installation
Login
mysql
Create a database
CREATE DATABASE 'staytus' CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci;
Create a new user
CREATE USER 'staytus'@'127.0.0.1' IDENTIFIED BY '*********************';
Grant privileges on new database to new user
GRANT ALL ON 'staytus'.* TO 'staytus'@'127.0.0.1';
Flush privileges and exit
FLUSH PRIVILEGES;
exit
Create a new unix user for Staytus to run as. This will create a user called staytus
with a home directory in /opt/staytus
useradd -r -d /opt/staytus -m -s /bin/bash staytus
Login as the new user
su - staytus
Download the application from GitHub
git clone https://github.com/adamcooke/staytus /opt/staytus/staytus
Navigate to the new installation directory
cd /opt/staytus/staytus
Install Ruby dependencies
bundle install --deployment --without development:test
Copy the example database config and set the respective parameters
cp config/database.example.yml config/database.yml