---
title: "Deploy OpenShip"
description: "Self-hosted deployment platform to build, ship, and route apps."
category: "Automation"
url: https://railway.com/deploy/openship-updated
---

# Deploy OpenShip

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

**[Deploy OpenShip on Railway](https://railway.com/template/openship-updated)**

- **Category:** Automation

## Template content

### redis https://cdn.sanity.io/images/sy1jschh/production/0ce0bfdcfbdbf69662b1116671f97c2dd788b655-157x157.svg

- **Image:** redis:8.2
- **Start command:** `/bin/sh -c "rm -rf $RAILWAY_VOLUME_MOUNT_PATH/lost+found/ && exec docker-entrypoint.sh redis-server --requirepass $REDIS_PASSWORD --save 60 1 --dir $RAILWAY_VOLUME_MOUNT_PATH"`

### postgres https://devicons.railway.app/i/postgresql.svg

- **Image:** ghcr.io/railwayapp-templates/postgres-ssl:18

### api

- **Source:** arloodots/openship
- **Public domain:** Yes

### dashboard

- **Source:** arloodots/openship
- **Public domain:** Yes

## Documentation

# 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

* [Openship GitHub Repository](https://github.com/arloodots/openship)
* [Openship Documentation](https://openship.io/docs?utm_source=chatgpt.com)
* [Openship Quick Start](https://github.com/arloodots/openship
* [Openship How It Works](https://github.com/arloodots/openship)
* [Openship Contributing Guide](https://github.com/arloodots/openship/blob/main/CONTRIBUTING.md)

### Implementation Details

The Railway deployment consists of four services:

| Service    |   Port | Purpose                                  |
| ---------- | -----: | ---------------------------------------- |
| Dashboard  | `3001` | Openship web interface                   |
| API        | `4000` | Backend API and deployment control plane |
| PostgreSQL | `5432` | Persistent application database          |
| Redis      | `6379` | Cache and API runtime service            |

The architecture is:

```text
                         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:

```env
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:

```env
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:

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

### Authentication and Secrets

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

```env
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:

```env
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:

```env
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:

| Service    | Proxy      | Target Port | Public Access                            |
| ---------- | ---------- | ----------: | ---------------------------------------- |
| Dashboard  | HTTP Proxy |      `3001` | Yes                                      |
| API        | HTTP Proxy |      `4000` | Not required for dashboard communication |
| PostgreSQL | TCP        |      `5432` | No                                       |
| Redis      | TCP        |      `6379` | No                                       |

Generate a domain for the Dashboard through:

**Dashboard → Settings → Networking → Generate Domain**

The resulting domain is automatically referenced by:

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

and by the API:

```env
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:

```env
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:

```text
3001
```

and the API listens on:

```text
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:

```text
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:

```bash
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.



## Similar templates

- [N8N Main + Worker](https://railway.com/deploy/n8n-main-worker) — Deploy and Host N8N with Inactive worker.
- [Evolution API with n8n](https://railway.com/deploy/evolution-api-with-n8n) — [Jul'26] WhatsApp automation platform using Evolution API, n8n & PostgreSQL
- [Postgres Backup](https://railway.com/deploy/postgres-s3-backups) — Cron-based PostgreSQL backup to bucket storage

Open this page in a browser: https://railway.com/deploy/openship-updated
