No port mapping
The site is served on its HTTPS address, not on a port you publish yourself.
Nginx static site hosting without the server block. Nginx runs on a dedicated server we provision, secure and run, already serving HTTPS. Copy your built files into its content folder over SSH and they are live at once. Add your own domain when you are ready.
No login to guard and nothing to configure. Your SSH key is the only way in.
Nginx is an open source web server known for serving files fast. This template runs it on its own server to serve a static site: HTML, CSS, JavaScript and images, with no code running behind them.
Anyone with a built site, from a landing page to the output of a static site generator, who wants it on their own server.
When the site is finished files and you want HTTPS without configuring Nginx. For PHP or server code, use an app template or deploy from GitHub.
An Nginx static site by hand takes about 12 commands: install, a folder and its permissions, a server block, a symlink, a test, a restart, the firewall and Certbot. Most guides listen on port 80 and add HTTPS last. Here Nginx starts on HTTPS. Serving static files with Nginx is just copying them in.
Visitors
HTTPS
Nginx
Content folder
Your SSH key
| An Nginx static site by hand | An Nginx static site on Selfhost.dev |
|---|---|
| Install Nginx, then create the folder and set its owner | Nginx running, with a welcome page to replace |
| Write a server block for port 80, symlink it, test it, restart | No server block to write |
| Certbot and a firewall rule for HTTPS | HTTPS on a generated address from the start |
| Point a domain at the server, then reissue the certificate | Attach your own domain in Settings |
Nginx Docker guides start with docker run -p 8080:80, mount a folder into /usr/share/nginx/html and leave HTTPS for later. Here the container is already running behind a generated HTTPS address before you deploy a single file. Nothing to map, mount or rebuild when the site changes.
The site is served on its HTTPS address, not on a port you publish yourself.
Your files go into the content folder shown in Overview, on the server itself.
Copy changed files over SSH and Nginx serves them straight away; no image to rebuild.
Nginx static site requirements here are short. The smallest server we offer, 4 GB on x86 or ARM, is plenty for serving files. Your built site. A project SSH key to copy them in. A domain is optional; the site works on its generated HTTPS address until you attach one.
Launch, copy your files, add your domain.
Launch opens the Nginx template in the console. Pick a 4 GB server. The template deploys in about ten minutes and starts with a welcome page.
Add a project SSH key, then copy your built site into the content folder shown in Overview. Nginx serves it straight away.
When you are ready, add your own domain in Settings. Until then the site answers on its generated HTTPS address.
Nginx static site hosting here costs the server and nothing else. Prepaid credits pay for it by the hour: $0.02/hr for a European 4 GB server, about $15 to $16 a month. Traffic is included, so a busy day for your site adds nothing to the bill.
| Item | Cost |
|---|---|
| The Nginx template | $0 |
| Bandwidth to your site | $0, traffic is included in the server price |
| Optional daily backups | +20% of the server price |
| An app beside the site, deployed from GitHub | Shares the same server |
| Server | RAM, cores, disk | Where | Rate | About a month |
|---|---|---|---|---|
cx23 (recommended) | 4 GB, 2 cores, 40 GB | Europe | $0.02/hr | $15.18 |
cax11 (ARM) | 4 GB, 2 cores, 40 GB | Europe | $0.02/hr | $16.35 |
cpx21 | 4 GB, 3 cores, 80 GB | US | $0.12/hr | $87.75 |
cpx22 | 4 GB, 2 cores, 80 GB | Singapore | $0.10/hr | $72.56 |
Monthly figures assume 730 hours.
With a card on file or a past top-up, the site keeps running for 5 days after your balance reaches zero. Then it is stopped and kept for 24 hours before it is deleted; a top-up in that time restarts it. After the delete, a copy of the server is kept for 14 days and you can restore the project from the Projects page. We email you when the balance reaches zero and again when it stops. Welcome-credit-only servers are deleted at zero, with a 3-day copy if the project went live.
Price another size or region in the calculator, no signup.
Free static hosts such as GitHub Pages and Cloudflare Pages publish from Git onto a shared platform. An Nginx static site here runs on a server of your own, in the same project as any app you deploy from GitHub. Your site and your apps share one server and one bill.
| A free static host | Nginx on Selfhost.dev | |
|---|---|---|
| Where it runs | A shared platform | Your own server |
| Your app or API beside it | A separate service | The same project, from GitHub |
| How you publish | A Git push or a drag and drop | Copy files over SSH |
The console estimates about ten minutes for the Nginx template after the server is ready; first-time server provisioning adds time.
Nothing here in your way? The template deploys in about ten minutes.
Launch NginxTell us what you plan to run beside it. We reply with the server we would pick and what it costs a month.
Add a project SSH key in the console, connect as the shell user and copy your built files into the content folder shown in Overview. Nginx serves the changes immediately, with no reload. There is no browser uploader, so any tool that copies over SSH works, from scp to rsync.
No. This template serves static files only: HTML, CSS, JavaScript and images. There is no PHP. For a WordPress site, use the WordPress template. For an app or API, deploy it from GitHub into the same project, so it runs on the same server as the site.
Yes, from the start. The template answers on a generated HTTPS address before you copy a single file, so there is no Certbot step and no port 80 server block to write. When you attach your own domain in Settings, the site serves on it too.
No. The site has no website login, admin panel or password to protect. Publishing works through a project SSH key: only keys you add in the console can copy files into the content folder. Visitors only ever see the site itself.
Both templates serve a static site the same way here: files copied over SSH into a content folder, on HTTPS, with no login. Pick the web server your team already knows. If you want Caddy, the Caddy template deploys it the same way.
Selfhost.dev is a managed self hosting platform for developers and small teams. Open source apps and databases on dedicated servers you control, billed by the hour, in six locations across three continents.
Best for: Static sites beside the apps that feed them, WordPress, Strapi and managed PostgreSQL, MySQL and Redis.