Nytt publiseringssystem
Oppdatering av hjemmesiden vår pågår! Forvent feil og korrigeringer fremover.
DirectAdmin is a control panel for web hosting that helps manage domains, files, email, databases, and more—similar to cPanel, but generally faster and more lightweight. With hosting from Webspesialis
DirectAdmin is a control panel for web hosting that helps manage domains, files, email, databases, and more—similar to cPanel, but generally faster and more lightweight.
With hosting from Webspesialisten, it is included technical help to get your Node.js up and working. We can help you automate things if you need – at no cost. We offer a free version of DirectAdmin for our customers (unlimited accounts).
We reccomend that you work with the «admin» user in shell, even though you also have access to root.
This guide shows how to deploy a Node.js app called myapp on mydomain.com using Apache as a reverse proxy on a DirectAdmin server. This setup supports HTTPS, routing, and runs your app with PM2.
Note that by default, all domains are owned by a user named «admin» (/home/admin/domains/mydomain.com). You can create sub-users if you want more seperation.
/home/youruser/
└── domains/
└── mydomain.com/
├── public_html/ ← Can be empty or used for static files
└── myapp/ ← Your Node.js app
├── app.js
├── package.json
├── routes/
└── views/
cd ~/domains/mydomain.com/myapp
nvm use 20 # Or your installed Node.js version
npm install
pm2 start app.js --name myapp
pm2 save
pm2 startup
Make sure your app.js listens on the correct port:
const port = process.env.PORT || 3000;
app.listen(port, () => {
console.log(`myapp running on port ${port}`);
});
|*if !PROXY_OVERRIDE|
ProxyRequests Off
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:3000/
ProxyPassReverse / http://127.0.0.1:3000/
|*endif|
This forwards all traffic to your Node.js app running on port 3000.
To serve a static frontend from public_html and route API calls to Node.js:
ProxyPass /api/ http://127.0.0.1:3000/api/
ProxyPassReverse /api/ http://127.0.0.1:3000/api/
This lets you serve:
https://mydomain.com/ → static site or PHP-scriptshttps://mydomain.com/api/ → Node.js backend| Step | Task | Description |
|---|---|---|
| 1️⃣ | Run Node.js app with PM2 | App runs on port 3000 in the background |
| 2️⃣ | Set up Apache reverse proxy | Traffic forwarded to your app |
| 3️⃣ | Enable SSL (Let’s Encrypt) | Enforce HTTPS securely |
| 4️⃣ | Optional static + API | Use Node.js for API, Apache for static files |
🎉 Done! Your Node.js app is now live on mydomain.com using Apache reverse proxy and HTTPS.