Docs
Docs menu

Railway, Render and Kubernetes

Run the Moru node image on Railway, Render or a Kubernetes cluster, with a persistent volume and backups.

The node image runs on any platform that gives a container a persistent volume. Whatever the platform, the node needs:

  • one instance, never more, with a persistent volume at /data,
  • MORU_PUBLIC_URL set to the address people use,
  • HTTP traffic on port 7070, with TLS in front, no response buffering and long reads (the UI’s event stream and runners’ long-polls stay open).

After the first start, the setup link for the first admin is in the logs: search for setup#code=. See Create the first admin.

Railway#

Railway’s settings live in its dashboard, so there’s no config file.

  1. New service → Docker Image: ghcr.io/webstonehq/moru-node:latest.
  2. Volume: attach one, mounted at /data. Railway mounts volumes as root; the image hands the volume to its own user (uid 10001) on start.
  3. Variables: MORU_PUBLIC_URL = https://${{RAILWAY_PUBLIC_DOMAIN}}, or your own domain.
  4. Networking: generate a domain (or add yours) with target port 7070.
  5. Settings → Deploy: keep one replica. Health check path: /api/v0/health.
  6. Deploy, then open the logs and find the setup link.

Railway’s proxy connects from addresses that aren’t documented, so MORU_TRUSTED_PROXIES isn’t set here. Without it, failed sign-ins are counted per proxy address rather than per client. If you know the range your proxy uses, set MORU_TRUSTED_PROXIES to it.

Backups, through the Railway CLI:

railway ssh -- moru-node backup - > moru-$(date +%F).tgz

Render#

A web service running the image, with a persistent disk at /data. Save this as render.yaml in a repo Render can read, set your URL, and create it with New → Blueprint. Or create a web service from the image by hand with the same settings.

services:
  - type: web
    name: moru
    runtime: image
    image:
      url: ghcr.io/webstonehq/moru-node:latest
    # Persistent disks need a paid plan.
    plan: starter
    numInstances: 1
    healthCheckPath: /api/v0/health
    envVars:
      # The URL people use: https://<service>.onrender.com, or your own domain.
      - key: MORU_PUBLIC_URL
        value: https://CHANGE-ME.onrender.com
      # Tells Render which port the node listens on.
      - key: PORT
        value: '7070'
    disk:
      name: moru-data
      mountPath: /data
      sizeGB: 10

Then open the service’s logs and find the setup link.

  • A persistent disk needs a paid plan and turns off zero-downtime deploys. That’s fine: the node is a single instance anyway.
  • As on Railway, MORU_TRUSTED_PROXIES isn’t set, because Render’s proxy addresses aren’t documented. Failed sign-ins are counted per proxy address.

Backups: open the service’s Shell, run moru-node backup /tmp/moru.tgz, and copy the file off over Render’s SSH access, or pipe moru-node backup - to restic from there.

Kubernetes#

A StatefulSet with one replica and a 10 GiB volume, a Service, and an example Ingress for ingress-nginx. Save it as moru.yaml, set the image tag, MORU_PUBLIC_URL and the host name, then apply it:

apiVersion: v1
kind: Service
metadata:
  name: moru
spec:
  selector:
    app: moru
  ports:
    - name: http
      port: 7070
      targetPort: http
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: moru
spec:
  serviceName: moru
  # The node is a single instance; never more than one.
  replicas: 1
  selector:
    matchLabels:
      app: moru
  template:
    metadata:
      labels:
        app: moru
    spec:
      securityContext:
        runAsUser: 10001
        runAsGroup: 10001
        fsGroup: 10001
        fsGroupChangePolicy: OnRootMismatch
      terminationGracePeriodSeconds: 30
      containers:
        - name: moru
          image: ghcr.io/webstonehq/moru-node:latest
          env:
            - name: MORU_PUBLIC_URL
              value: https://moru.example.com
            # The ingress controller's pods connect from the cluster's private ranges.
            - name: MORU_TRUSTED_PROXIES
              value: private
          ports:
            - name: http
              containerPort: 7070
          readinessProbe:
            httpGet:
              path: /api/v0/health
              port: http
          livenessProbe:
            httpGet:
              path: /api/v0/health
              port: http
            initialDelaySeconds: 20
            periodSeconds: 30
          resources:
            requests:
              cpu: 500m
              memory: 1Gi
          volumeMounts:
            - name: data
              mountPath: /data
  volumeClaimTemplates:
    - metadata:
        name: data
      spec:
        accessModes: ['ReadWriteOnce']
        resources:
          requests:
            storage: 10Gi
---
# An example for ingress-nginx; adapt it to your controller. What matters: no
# response buffering, reads of at least 5 minutes, and request bodies big enough
# for your pushes.
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: moru
  annotations:
    nginx.ingress.kubernetes.io/proxy-buffering: 'off'
    nginx.ingress.kubernetes.io/proxy-request-buffering: 'off'
    nginx.ingress.kubernetes.io/proxy-read-timeout: '300'
    nginx.ingress.kubernetes.io/proxy-body-size: 200m
spec:
  ingressClassName: nginx
  tls:
    - hosts: [moru.example.com]
      secretName: moru-tls
  rules:
    - host: moru.example.com
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: moru
                port:
                  name: http
kubectl apply -f moru.yaml
kubectl logs moru-0 | grep 'setup#code='

The pod runs as uid 10001 with fsGroup, so the volume is writable without root.

Run commands and take backups with kubectl exec:

kubectl exec moru-0 -- moru-node create-user jon
kubectl exec moru-0 -- moru-node backup - > moru-$(date +%F).tgz

Restoring on Kubernetes#

moru-node restore only writes into an empty data directory, with the node stopped. Scale the StatefulSet down, replace the volume claim with an empty one, and restore into it from a one-off pod:

kubectl scale statefulset moru --replicas 0
kubectl delete pvc data-moru-0

Create the claim again and a pod that mounts it, as restore.yaml (use the same image tag as the StatefulSet):

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: data-moru-0
spec:
  accessModes: ['ReadWriteOnce']
  resources:
    requests:
      storage: 10Gi
---
apiVersion: v1
kind: Pod
metadata:
  name: moru-restore
spec:
  securityContext:
    runAsUser: 10001
    runAsGroup: 10001
    fsGroup: 10001
  containers:
    - name: restore
      image: ghcr.io/webstonehq/moru-node:latest
      command: ['sleep', 'infinity']
      volumeMounts:
        - name: data
          mountPath: /data
  volumes:
    - name: data
      persistentVolumeClaim:
        claimName: data-moru-0
kubectl apply -f restore.yaml
kubectl exec -i moru-restore -- moru-node restore - < moru-2026-11-10.tgz
kubectl delete pod moru-restore
kubectl scale statefulset moru --replicas 1

The node rebuilds its index when it starts.

Runners on these platforms#

A runner needs only git, the moru-runner binary and the toolchains your repositories use, so it can run in a container on Railway, Render or Kubernetes, or on servers and developers’ machines. It only makes outbound connections to the node. The container is then the only boundary around its agents; see Where to run a runner.

See Add a runner.

Command menu
Search for a page, repository, change or request, or run a command