Hosting
Hosting options for Jeasx
Jeasx supports various hosting modes tailored to different needs and preferences. You can host Jeasx on a dedicated server or VPS, deploy it via a Docker container, or opt for a serverless approach.
Before you deploy
Wherever you host your application, the same basics apply:
- Build first: set
NODE_ENV=production, runnpm run buildand start the server withnpm start. Set it for the build, too, as the build readsjeasx.config.jsand your.env.productionfile. Only routes and files that exist at build time are served. - HOST & PORT:
jeasx startlistens on all interfaces (::) and port3000by default. SetPORTif your platform expects another port (see configuration). - Health check: let your platform or load balancer check a cheap route, e.g. a
src/[health].jsonfile containing{ "status": "ok" }, which is served at/health. - Graceful shutdown: Jeasx closes the server cleanly on
SIGINTandSIGTERM, so running requests can finish when a container is stopped or replaced. - Secrets: pass secrets as environment variables of your platform and don't ship
.envfiles with secrets in your image. - Security: terminate TLS in a reverse proxy and go through the security checklist.
Hosting on a dedicated / virtual private server (VPS)
Typically, a Jeasx application requires less than 50 MB of RAM and a single (v)CPU. Therefore the smallest server should get you started. Install Node.js, then build and start your application as described above.
In order to minimize the CPU footprint of a Jeasx application, it is highly recommended that TLS termination is offloaded to a reverse proxy, such as Caddy.
Running Jeasx with Docker Compose
To keep things simple and maintainable, Docker Compose is a great lightweight infrastructure for running Jeasx applications on your own VPS. The Jeasx website along with the expo and other projects are hosted this way with minimal costs and efforts.
Below is a minimal compose.yml to get you started with a Jeasx application and Caddy. Caddy automatically creates TLS certificates for your domain with Let's Encrypt and compresses your payloads.
services:
jeasx-quickstart:
image: jeasx/quickstart:snapshot
build:
context: jeasx-quickstart
restart: always
deploy:
resources:
limits:
memory: 64M
caddy:
image: caddy:alpine
restart: always
cap_add:
- NET_ADMIN
ports:
- 80:80
- 443:443
- 443:443/udp
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
- caddy_data:/data
- caddy_config:/config
deploy:
resources:
limits:
memory: 64M
volumes:
caddy_data:
caddy_config:
And here is the minimal Caddyfile:
quickstart.jeasx.dev {
encode
reverse_proxy http://jeasx-quickstart:3000
}
Container-based hosting
A powerful self-hosted option is to install Dokploy on your server. Dokploy uses Docker under the hood and comes with a nice user interface to create deployments directly from GitHub.
For straightforward Node.js-based hosting, platforms like Railway and Koyeb are excellent choices. Both support deploying Docker containers, which is the recommended option, as the default builders (e.g. Railpack / Buildpack) create containers that use significantly more resources than the optimized Dockerfile provided via the quickstart template.
If you prefer Docker containers exclusively with a fixed pricing model, Sliplane is a viable option.
Serverless hosting
For a serverless setup, Vercel is an option, as Jeasx can be bootstrapped with the necessary configurations via the quickstart template. Have a look at the Jeasx expo running at Vercel.
Other serverless platforms should work with additional configurations, but haven't been tested.