Appearance
Deploy a Node.js app
A complete walkthrough: from a fresh pod to a Node.js app serving HTTPS traffic on your own domain.
What you'll build
- A Small pod running Ubuntu 24.04
- Node.js 20 LTS
- A trivial Express app on internal port 3000
- Mapped to
app.example.comover HTTPS
1. Create the pod
In the console: Pods → New
- Workload: Ubuntu
- Version: 24.04
- Compute: Small (1 vCPU, 1 GB RAM)
- Region: nearest to your users
- Storage: Tiny (5 GB)
- SSH key: paste one or pick a saved one. (Skip it and a one-time login password is shown right after creation - save it, you'll need it in step 2.)
Click Create Pod. It's Running in about a minute.
2. SSH in
Open the pod's Connection Strings tab and find the external port assigned to SSH (e.g. 3001, mapped to internal 22). Then:
bash
ssh -p 3001 ubuntu@your-pod.microapps.io(Substitute the external port and public hostname from your Connection Strings tab.)
3. Install Node.js
bash
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs
node --version4. Write the app
bash
mkdir ~/hello && cd ~/hello
npm init -y
npm install expressindex.js:
js
const express = require('express')
const app = express()
app.get('/', (_, res) => res.send('Hello from MicroApps!'))
app.listen(3000, () => console.log('Listening on 3000'))The app listens on internal port 3000. We'll expose it via a domain mapping in step 7 - no need to mess with port mapping for HTTP traffic.
5. Run it under systemd
/etc/systemd/system/hello.service:
ini
[Unit]
Description=Hello app
After=network.target
[Service]
ExecStart=/usr/bin/node /home/ubuntu/hello/index.js
Restart=always
User=ubuntu
WorkingDirectory=/home/ubuntu/hello
[Install]
WantedBy=multi-user.targetbash
sudo systemctl daemon-reload
sudo systemctl enable --now hello
sudo systemctl status hello6. Add the domain
In the console: Domains → New domain → app.example.com
Publish the DNS records shown on the domain's DNS tab at your registrar - the verify-domain ownership TXT and the SSL _acme-challenge CNAME. Verification runs automatically once the records resolve; Recheck DNS hurries it along.
7. Map domain to pod
On the verified domain: Map a pod
- Traffic Type: HTTPS
- Pod: your hello pod
- Port: 3000 (the internal port your app listens on)
Our reverse proxy will accept HTTPS traffic on the public side and forward it to your pod's internal port 3000. You don't need to assign an external port to 3000 yourself.
8. Enable SSL
On the same page: Enable SSL.
9. Visit your app
Open https://app.example.com. You'll see "Hello from MicroApps!".
That's it. You have a Node.js app on the internet, on your own domain, with HTTPS. Billing is hourly from your credit - see the pricing page.