DocsRemix

Remix

Deploy a Remix app on Ruust: built with Vite, served on HTTPS by an always-on Egg.

Ruust hands the repo to Nixpacks, which recognises Remix from the @remix-run/react dependency in your package.json. Nixpacks runs a build such as remix vite:build to produce build/server and build/client, then serves it (the exact command is chosen by the Nixpacks Remix support, not pinned by Ruust). Because your Egg is a real always-on Node server, loaders, actions and server-side rendering all run, with no cold starts and no functions to work around.

Deploy it

  1. Push your app to a Git repo.
  2. In the dashboard, choose New Egg and connect the repo.
  3. Pick a size and a region, then lay the Egg. Ruust builds with remix vite:build and hatches it on HTTPS.

The port

The built-in remix-serve reads the PORT environment variable and binds to 0.0.0.0 for you, so the simplest setup needs no code. Ruust sets PORT; remix-serve listens on it. Set the start command with a Procfile so the compiled server runs rather than the dev server: the web: line is honoured by the Nixpacks build, not by Ruust itself, and there is no Ruust-level override (it is ignored when you supply your own Dockerfile).

text
web: remix-serve ./build/server/index.js
A Procfile at the repo root pins the start command.

If you run your own Express server (for extra middleware or an API), you must read PORT and bind to 0.0.0.0 yourself. Binding to localhost is the top reason an Egg builds but never hatches, because nothing outside the container can reach it. Point the Procfile at your entry with web: node ./server.js.

javascript
import { createRequestHandler } from '@remix-run/express';
import express from 'express';

const app = express();
app.use(express.static('build/client'));
app.all(
  '*',
  createRequestHandler({
    build: await import('./build/server/index.js'),
  }),
);

const port = process.env.PORT || 3000;
app.listen(port, '0.0.0.0', () => {
  console.log('Listening on ' + port);
});
Read PORT and bind to 0.0.0.0 in a custom Express server.

Environment variables

Set server-side variables (database URLs, API keys) on the Egg. They are available at build and run time, encrypted at rest and never printed in logs. Read them in loaders and actions with process.env; they stay on the server and never reach the browser.