Skip to content

Creating a New Server

Jason Kiesling edited this page Apr 8, 2020 · 3 revisions
  1. Obtain a server with Ubuntu 18.04.
  2. Update all packages to be the latest versions.
  3. Restrict SSH access to only authorized users.
    1. Create a new group via sudo groupadd sshlogin.
    2. Add your account to the group via sudo usermod -a -G sshlogin [username].
    3. Edit /etc/ssh/sshd/config and add a line saying AllowGroups sshlogin.
    4. Restart the SSH server via sudo systemctl restart sshd.
    5. BEFORE EXITING SSH, in a new terminal test that your account can still SSH in.
  4. Create SSH key and add to GitHub.
  5. Clone all 3 repos via SSH.
  6. Add MYR firebase key config file.
  7. Install yarn.
  8. Run yarn install or npm install for all repos.
  9. Install MongoDB.
  10. Install pm2 npm install pm2@latest -g.
  11. In the MYR-backend directory, run pm2 start npm --name "MYR Beta Server" -- start.
  12. Install Nginx.
  13. Add Nginx configuration.
  14. Add SSL files.
  15. Restart Nginx.
  16. Run pm2 startup to get command to have pm2 run on boot.
  17. Run pm2 save to save config.