How do I deploy my Node.js app?
- In the panel, open My servers and click your server.
- On the Overview tab, wait for the App row to say "Node.js is ready". The page refreshes itself.
- Open the link in the Site address row. The sample page shows the Node.js version.
Running your own app
Connect over SSH and switch to the app user:
su - app
cd ~/uygulama
Bring your code here, for example with git clone. You can delete the sample server.js. Install the dependencies and start your app:
npm install
pm2 delete uygulama
pm2 start server.js --name uygulama
pm2 save
Your app should listen on port 3000. Caddy forwards incoming HTTPS requests to that port.
Your own domain
- Point your domain's A record to your server's IP address.
- As root, replace the old name everywhere:
sed -i 's/OLD_NAME/yourdomain.com/g' /etc/caddy/Caddyfile.OLD_NAMEis the part afterhttps://in the address shown in the panel. - Run
systemctl reload caddy.
Caddy gets and renews the certificate by itself.
Only 80, 443 and 22 for SSH are open to the outside.
No server yet? Order a server with Node.js installed: you choose the size and pay for what you choose.
Thanks for your feedback!