Your hosting can run Node.js applications, such as a Next.js website. Enhance starts your app, keeps an eye on it, and forwards your website’s visitors to it – there’s no need to set up a proxy yourself. Let’s Encrypt SSL certificates carry on working as normal.
Before you start
Upload or build your app in a folder inside your website’s home folder (not inside public_html), for example using SSH or FTP. Make sure its dependencies are installed and, if needed, that it has been built (for example with npm install and npm run build).
Deploy your app
- Select Websites in the left side bar, then select the website you want to manage.
- In the menu along the top, open the Advanced drop-down and select Node.js.
- Select Deploy app.
- Fill in the form (see below), then select Deploy.
| Setting | What to enter |
|---|---|
| Automatic (Production) or Manual (Development) | Choose Automatic for a live website: your app is started automatically, and restarted if it stops. Manual is for development: visitors are still forwarded to your app, but you start it yourself over SSH. |
| Node version | The version of Node.js your app needs. stable is a good default. |
| Startup command | The command that starts your app, for example npm start (which runs next start for a Next.js app). |
| Working directory | The folder your app is in, inside your website’s home folder. |
| Proxy enabled | Leave this on to forward visitors from your website’s primary domain to your app. |
| Path | Leave blank to send your whole website to the app, or enter a path to use the app for just part of your site. |
| Port | The port your app listens on (3000 is suggested). Your app must listen on 0.0.0.0 on this port. Many frameworks, including Next.js, read the port automatically from the PORT setting. |
| Allow web socket proxy upgrade | Tick this only if your app uses web sockets. |
Managing your app
Once deployed, your app appears on the Node.js page with its Port, Startup command, Version, Working directory, Start mode and Proxy settings. Use the pencil icons to change a setting, and the menu (⋮) for more options. The panel on the right shows your app’s output, which is the first place to look if it won’t start.
Your app also appears in the Applications box on your website’s home page, with a Manage button.
Using Node.js over SSH
To work with Node.js from the command line, for example to install packages or build your app, first set up Node.js for your SSH user:
- Connect over SSH and run:
source /usr/bin/install_nvm_and_node.sh - Close your SSH session and connect again.
- You can now use nvm to choose a Node.js version.
for examplenvm install 20thennvm use 20. - Check the version with
node -v.