Railway

Deploy OpenShip

Self-hosted deployment platform to build, ship, and route apps.

Deploy OpenShip

Just deployed

/data

/var/lib/postgresql/data

Just deployed

Just deployed

Deploy and Host Openship on Railway

Openship is an open-source, self-hostable deployment platform with built-in CI/CD. It connects to repositories, detects application configuration, builds and deploys services, manages domains and TLS, and provides a dashboard and API for controlling deployments. Openship supports modern application stacks, databases, workers, WebSockets, storage, rollbacks, and automated push-to-deploy workflows.

About Hosting Openship

Hosting Openship on Railway provides a dedicated control plane composed of a dashboard, API, PostgreSQL database, and Redis service. The dashboard provides the web interface, while the API handles authentication, projects, deployments, configuration, and communication with the supporting services.

The Railway configuration uses private networking between the dashboard, API, PostgreSQL, and Redis. The dashboard is publicly accessible through a Railway domain, while the API remains reachable internally through its Railway private domain. PostgreSQL provides persistent application data and Redis handles the caching and runtime requirements.

The dashboard and API run as separate services, making the architecture easy to maintain and scale independently. Railway also provides HTTPS, service discovery, secrets, deployments, and infrastructure management without requiring manual server configuration.

Common Use Cases

  • Git-Based CI/CD: Connect repositories and automatically build and deploy applications when tracked branches receive new commits.
  • Application Management: Manage multiple applications, environments, deployments, domains, databases, and infrastructure from a centralized dashboard.
  • Self-Hosted Deployment Platform: Run your own deployment control plane while retaining control over application configuration, credentials, deployment workflows, and infrastructure.

Dependencies for Openship Hosting

  • Openship Dashboard — Web interface for managing the Openship control plane.
  • Openship API — Backend API responsible for application and deployment management.
  • PostgreSQL — Persistent database used by the API.
  • Redis — Required runtime service for the API.
  • Railway Private Networking — Used for communication between dashboard, API, PostgreSQL, and Redis.
  • Railway Public Domain — Required for accessing the dashboard and configuring the public Openship URL.

Deployment Dependencies

Implementation Details

The Railway deployment consists of four services:

ServicePortPurpose
Dashboard3001Openship web interface
API4000Backend API and deployment control plane
PostgreSQL5432Persistent application database
Redis6379Cache and API runtime service

The architecture is:

                         Internet
                            |
                            v
                    Railway Public Domain
                            |
                            v
                       Dashboard
                         :3001
                            |
                   Railway Private Network
                            |
                            v
                          API
                         :4000
                       /       \
                      /         \
                     v           v
               PostgreSQL       Redis
                  :5432         :6379

Dashboard Configuration

Configure the Dashboard service with:

PORT=3001
NODE_ENV=production
OPENSHIP_TARGET=local
INTERNAL_API_URL=http://${{api.RAILWAY_PRIVATE_DOMAIN}}:4000
OPENSHIP_PUBLIC_URL=https://${{RAILWAY_PUBLIC_DOMAIN}}
NEXT_PUBLIC_API_PROXY=true
NEXT_PUBLIC_PUBLIC_URL=https://${{RAILWAY_PUBLIC_DOMAIN}}

The dashboard listens on port 3001.

INTERNAL_API_URL uses the API's Railway private domain, keeping dashboard-to-API communication inside Railway's private network.

OPENSHIP_PUBLIC_URL and NEXT_PUBLIC_PUBLIC_URL use the Railway public domain so the application can construct correct public URLs.

API Configuration

Configure the API service with:

PORT=4000
NODE_ENV=production
REDIS_URL=redis://${{redis.RAILWAY_PRIVATE_DOMAIN}}:6379
CLOUD_MODE=false
DEPLOY_MODE=docker
TRUST_PROXY=true
DATABASE_URL=postgresql://${{postgres.POSTGRES_USER}}:${{postgres.POSTGRES_PASSWORD}}@${{postgres.RAILWAY_PRIVATE_DOMAIN}}:5432/${{postgres.POSTGRES_DB}}
INTERNAL_TOKEN=${{secret(64, "abcdef0123456789")}}
OPENSHIP_TARGET=local
SYSTEM_DEBUG_LOGS=false
BETTER_AUTH_SECRET=${{secret(64, "abcdef0123456789")}}
OPENSHIP_PUBLIC_URL=https://${{dashboard.RAILWAY_PUBLIC_DOMAIN}}
OPENSHIP_REQUIRE_REDIS=true
OPENSHIP_EXTRA_TRUSTED_ORIGINS=https://${{dashboard.RAILWAY_PUBLIC_DOMAIN}}

The API listens on port 4000.

Redis is similarly accessed through:

REDIS_URL=redis://${{redis.RAILWAY_PRIVATE_DOMAIN}}:6379

Authentication and Secrets

The API uses generated secrets for authentication and internal service communication:

INTERNAL_TOKEN=${{secret(64, "abcdef0123456789")}}
BETTER_AUTH_SECRET=${{secret(64, "abcdef0123456789")}}

BETTER_AUTH_SECRET is used by Openship's authentication system, while INTERNAL_TOKEN provides secure communication for internal API operations.

PostgreSQL

Add a Railway PostgreSQL service and keep it private.

The API connects using:

DATABASE_URL=postgresql://${{postgres.POSTGRES_USER}}:${{postgres.POSTGRES_PASSWORD}}@${{postgres.RAILWAY_PRIVATE_DOMAIN}}:5432/${{postgres.POSTGRES_DB}}

This provides:

  • Private database connectivity
  • Railway-managed credentials
  • No public database endpoint
  • Persistent application data

The API should reference the actual PostgreSQL service name if it differs from postgres.

Redis

Add a Railway Redis service and keep it private.

The API uses:

REDIS_URL=redis://${{redis.RAILWAY_PRIVATE_DOMAIN}}:6379
OPENSHIP_REQUIRE_REDIS=true

Redis provides the runtime caching and coordination layer required by the API.

Public Networking

The Dashboard should be the primary publicly accessible service.

Configure:

ServiceProxyTarget PortPublic Access
DashboardHTTP Proxy3001Yes
APIHTTP Proxy4000Not required for dashboard communication
PostgreSQLTCP5432No
RedisTCP6379No

Generate a domain for the Dashboard through:

Dashboard → Settings → Networking → Generate Domain

The resulting domain is automatically referenced by:

OPENSHIP_PUBLIC_URL=https://${{RAILWAY_PUBLIC_DOMAIN}}
NEXT_PUBLIC_PUBLIC_URL=https://${{RAILWAY_PUBLIC_DOMAIN}}

and by the API:

OPENSHIP_PUBLIC_URL=https://${{dashboard.RAILWAY_PUBLIC_DOMAIN}}
OPENSHIP_EXTRA_TRUSTED_ORIGINS=https://${{dashboard.RAILWAY_PUBLIC_DOMAIN}}

Railway handles HTTPS at the public edge, so Openship does not need a separate public TLS proxy for the dashboard.

Docker Deployment Mode

The API is configured with:

DEPLOY_MODE=docker
OPENSHIP_TARGET=local

This tells Openship that its deployment target is the local Docker-based environment represented by the configured deployment architecture.

Build & Start

The supplied configuration uses separate Dashboard and API services. Each service should use its documented application build/start configuration or the deployment image supplied by the template.

The dashboard listens on:

3001

and the API listens on:

4000

Accessing Openship

After deployment:

  1. Open the Dashboard service.
  2. Go to Settings → Networking.
  3. Select Generate Domain.
  4. Open the generated HTTPS URL.
  5. Complete the Openship authentication/setup flow.

The dashboard communicates with the API through:

http://${{api.RAILWAY_PRIVATE_DOMAIN}}:4000

while users access the dashboard through its public HTTPS domain.

The API itself does not need a public domain for the standard dashboard architecture.

Deployment Workflow

Once Openship is running, its documented workflow can be used to initialize and deploy projects:

openship init
openship deploy

Openship can detect project configuration, resolve build and start settings, build the application, and manage deployment state.

Important Railway Considerations

The upstream Openship documentation describes a broader self-hosted server architecture that can use Docker socket access, OpenResty, host networking, ports 80/443, and host-level SSH operations.

This Railway template instead uses Railway-native networking and separates the Openship dashboard, API, PostgreSQL, and Redis services.

Do not expose PostgreSQL or Redis publicly. Use Railway private domains for internal service communication.

Do not replace the Railway dashboard/API networking with an additional OpenResty or Caddy service unless a specific Openship deployment requirement calls for it.

Why Deploy Openship on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.


Template Content

More templates in this category

View Template
N8N Main + Worker
Deploy and Host N8N with Inactive worker.

jakemerson
120
View Template
Evolution API with n8n
[Jul'26] WhatsApp automation platform using Evolution API, n8n & PostgreSQL

codestorm
70
View Template
Postgres Backup
Cron-based PostgreSQL backup to bucket storage

Railway Templates
870