Skip to content

Instantly share code, notes, and snippets.

@superjojo140
Last active January 2, 2023 15:00
Show Gist options
  • Save superjojo140/38a6e4d419ae44245a1afe7ff4732a92 to your computer and use it in GitHub Desktop.
Save superjojo140/38a6e4d419ae44245a1afe7ff4732a92 to your computer and use it in GitHub Desktop.
[Checklist] New webapp on uberspace

This guide shows all steps to deploy a webapp on uberspace.

NOTE: This shows my personal workflow. This might not be fitting for your webapp.

Clone git repo

git clone <URL>

Install dependecies and build

npm install
npm run build

Create Database

Create all necessary databases and tables. For example via Uberspace PMA

Create and fill .env file

cp .env.example .env
nano .env

Supervisor Entry

This supervisor daemon cares about starting and restarting your backend in case of error or server reboot.

Create a new config file called <my_project>.ini in ~/etc/services.d/

[program:<my_project>]
directory=/home/<username>/<path_to_project_folder>
command=node src/app.js
autostart=yes
autorestart=yes

Read your new config file and start the service:

supervisorctl reread #read new config files
supervisorctl update #start all new services
supervisorctl status #list all services with status info
supervisorctl restart <my_project> #restart service

Register Route

To make your webservice reacheble under yourdomain/my_project use the web backends utilities

uberspace web backend set /<my_project> --http --port <PORT> --remove-prefix
uberspace web backend list

Update Project

If you made changes to your project and want to update form git repo use this command

git pull && npm run build && supervisorctl restart <my_project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment