Self-host Nginx with Levelrail

The Nginx web server on the official Alpine image, serving a persistent web root. It starts with the default welcome page; put your site files in the web root volume through the app's Files.

  • Authornginx
  • LicenceBSD-2-Clause
  • Memory64 MiB
  • Services1

How to self-host Nginx

  1. Pull the images

    One image is pulled on your server.

    Show images
    • nginx:1.27.2-alpine
  2. Create the app

    One service starts in a single Compose app, with 1 named volume mount for your data, on port 80.

  3. Fill in the secrets

    1 setting is preset, you do not have to fill in anything.

  4. Open it

    Without a domain the app gets an sslip.io address; add --domain SERVICE=HOST to use your own.

After the first start

  • Open the address to see the welcome page, then replace the files in /usr/share/nginx/html with your site.

Nginx requirements

Memory
About 64 MiB
Architectures
amd64 unknown, arm64 unknown
Ports
80
Domain
Optional, an sslip.io address is used without one
Settings
none to fill in
License
BSD-2-Clause, permissive license
  • Listed. It is in the catalog but not verified. Back up the data volume before changing an image tag.

Install Levelrail first

On a server with Levelrail running, run the command above, or open the dashboard: Apps, New app, Browse templates, then Nginx. New to Levelrail? Install it on a fresh VPS first.

docker pull ghcr.io/glincker/levelrail:latest

Then levelrail-cli login --device. See Getting started and the Nginx docs page.

Deploy Nginx your way

Every format below deploys the same pinned images. Pick the one that fits how you work.

Deploy Nginx from the CLI

Add --domain SERVICE=HOST to serve a service on your own domain, for example --domain nginx=app.example.com.

levelrail-cli templates install nginx --name my-nginx

Deploy Nginx with the API

Create a token in the dashboard first. Name, env and domains are the request fields.

curl -X POST -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  https://levelrail.example.com/api/v1/service-templates/nginx/install \
  -d '{
    "name": "my-nginx"
  }'

Nginx configuration

Nginx services

ServiceImagePortsVolumes
nginx nginx:1.27.2-alpine 80 nginx_html -> /usr/share/nginx/html

Nginx environment variables

VariableServiceValue
TZ nginx Preset by the template

Ports and volumes

Ports
80
Volumes
1 named mount: nginx_html -> /usr/share/nginx/html

Nginx FAQ

How much memory does Nginx need?

The catalog lists about 64 MiB of memory for Nginx.

Does Nginx run on arm64?

For Nginx, arm64 support is not confirmed; amd64 is unknown.

What licence is Nginx under?

Nginx is licensed under BSD-2-Clause, which is permissive, with few conditions on reuse.

Does Nginx need configuration before it starts?

No. The template fills in its own defaults.

Which ports does Nginx use?

Nginx listens on port 80 inside the stack.

Where does Nginx keep its data?

In a named volume: nginx_html mounted at /usr/share/nginx/html.

Can I deploy Nginx on Dokploy or Dokku?

The services and pinned images on this page can be run on any Docker host. The public Dokploy templates list has an entry with the id nginx for this app, so check that entry as well. Dokku deploys container images with its own commands, so the pinned image nginx:1.27.2-alpine is what you deploy there.

levelrail-cli templates install nginx --name my-nginx