Self-host Static Site + API Backend with Levelrail

A static frontend and a separate API service deployed together, the split most SPAs actually run.

  • Memory128 MiB
  • Archarm64
  • Services2

How to self-host Static Site + API Backend

  1. Pull the images

    2 images are pulled on your server.

    Show images
    • node:22-alpine
    • nginx:1.27-alpine
  2. Create the app

    2 services start in a single Compose app, on ports 4000, 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.

Static Site + API Backend requirements

Memory
About 128 MiB
Architectures
amd64 image published, arm64 image published
Ports
4000, 80
Domain
Optional, an sslip.io address is used without one
Settings
none to fill in
License
not yet recorded
  • Listed. It is in the catalog but not verified. Back up the data volume before changing an image tag.
  • Host ports. It publishes ports 4000, 80 on the host, so open them in the VPS firewall only if you want that.

Install Levelrail first

On a server with Levelrail running, run the command above, or open the dashboard: Apps, New app, Browse templates, then Static Site + API Backend. 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 Static Site + API Backend docs page.

Deploy Static Site + API Backend your way

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

Deploy Static Site + API Backend from the CLI

levelrail-cli templates deploy static-site-api-starter --name my-static-site-api-starter

Deploy Static Site + API Backend with the API

Create a token in the dashboard first. This one-click route deploys it as a trial app you can keep or remove.

curl -X POST -H "Authorization: Bearer $TOKEN" \
  https://levelrail.example.com/api/v1/service-templates/static-site-api-starter/deploy

Static Site + API Backend configuration

Static Site + API Backend services

ServiceImagePortsVolumes
api node:22-alpine 4000 none
static nginx:1.27-alpine 80 none

Static Site + API Backend environment variables

VariableServiceValue
NODE_ENV api Preset by the template

Ports and volumes

Ports
4000, 80
Volumes
none

Static Site + API Backend FAQ

How much memory does Static Site + API Backend need?

The catalog lists about 128 MiB of memory for Static Site + API Backend across its 2 services.

Does Static Site + API Backend run on arm64?

For Static Site + API Backend, an arm64 image is published; amd64 is image published.

Does Static Site + API Backend need configuration before it starts?

No. The template fills in its own defaults.

Which ports does Static Site + API Backend use?

Static Site + API Backend listens on ports 4000 and 80 inside the stack.

Can I deploy Static Site + API Backend on Dokploy or Dokku?

The services and pinned images on this page can be run on any Docker host. The public Dokploy templates list we compared does not have an entry with the same id for Static Site + API Backend, so on Dokploy you would use a Docker Compose application with the file from this page. Dokku deploys container images with its own commands, so the pinned image node:22-alpine, nginx:1.27-alpine is what you deploy there.

levelrail-cli templates deploy static-site-api-starter --name my-static-site-api-starter