---
title: "Farm.js on OpenShip. Your app, your servers."
description: "Farm.js is now an official OpenShip integration. OpenShip recognizes a Farm.js app from its config, builds it, and runs it on OpenShip Cloud or a Linux server you own."
---


# Farm.js on OpenShip. Your app, your servers.

KinfeMichael Tariku · Dec 2026

[OpenShip](https://openship.io) is an open-source deployment platform. It deploys from Git to OpenShip Cloud or to any Linux server you connect.

**Farm.js is now an official OpenShip integration.** Push a repo with a `farm.config.ts`, and OpenShip fills in the build command, the output directory, and the start command for you.

<span id="the-short-version" className="blog-heading-anchor" />

## The short version

- OpenShip detects Farm.js from `farm.config.*` plus `@farm.js/core` or `@farm.js/cli`.
- It builds with `farm build` and starts `node .farm/.output/server/index.mjs` on port 3000.
- The production image holds only `.farm/.output`. It doesn't need your source, your config, or the Farm.js CLI.
- Your own `build` and `start` scripts still take precedence.
- `openship.json` is optional. Add it only when you move the output directory.

<span id="how-openship-finds-a-farm-js-app" className="blog-heading-anchor" />

## How OpenShip finds a Farm.js app

OpenShip needs both signals:

- **A config file** at the app root: `farm.config.ts`, `.tsx`, `.mts`, `.cts`, `.js`, `.jsx`, `.mjs`, or `.cjs`.
- **A Farm.js package** in `dependencies` or `devDependencies`: `@farm.js/core` or `@farm.js/cli`.

A library that only imports a Farm.js helper has no config file, so OpenShip doesn't mistake it for an app.

```text
my-app/
  farm.config.ts      ← config marker
  package.json        ← "@farm.js/core", "@farm.js/cli"
  src/app/
    page.tsx
    api/hello/route.ts
```

<span id="what-it-runs" className="blog-heading-anchor" />

## What it runs

| Step   | OpenShip's default                      |
| ------ | --------------------------------------- |
| Build  | `farm build`                            |
| Output | `.farm/.output`                         |
| Start  | `node .farm/.output/server/index.mjs`   |
| Port   | `3000`, or `PORT` when the host sets it |

This is Farm.js's `node` target, the same output you'd run behind nginx or PM2. Pages, API routes, server functions, and streaming all run in one Node process.

The server starts with `node`, not `farm start`, so it still boots after a builder prunes devDependencies.

<span id="deploy-it" className="blog-heading-anchor" />

## Deploy it

1. **Connect.** Sign in to the [OpenShip dashboard](https://app.openship.io) and link the repo. Then pick a branch and a destination: OpenShip Cloud or your own server.
2. **Build.** OpenShip runs `farm build`.
3. **Ship.** The new version goes live. You can roll back to the previous one.
4. **Route.** Add a domain. OpenShip issues the HTTPS certificate.

Set runtime secrets in OpenShip, not in the repo. Farm.js reads them from the host environment when the server starts.

<span id="when-you-need-openship-json" className="blog-heading-anchor" />

## When you need openship.json

When you keep the defaults, you don't need the file at all.

If `farm.config.ts` moves the output, tell OpenShip where it went:

```ts
// farm.config.ts
import { defineConfig } from "@farm.js/core";

export default defineConfig({
  deploy: { target: "node", output: ".output" },
});
```

```json
{
  "framework": "farmjs",
  "outputDirectory": ".output",
  "startCommand": "node .output/server/index.mjs",
  "productionPaths": [".output"]
}
```

Check it before you push:

```bash
openship config validate
```

Two things break a first deploy:

- **A platform target.** `deploy.target: "vercel"` or `"cloudflare"` builds output that only that platform can serve. Remove it, or set it to `"node"`.
- **A production-only install.** `farm build` needs `@farm.js/cli`, a devDependency. Keep devDependencies installed for the build.

<span id="try-it" className="blog-heading-anchor" />

## Try it

```bash
pnpm create @farm.js/app my-app
cd my-app
git init && git add -A && git commit -m "Start my-app"
```

Push it to GitHub, then sign in to the [OpenShip dashboard](https://app.openship.io) and connect the repo. To run OpenShip on your own server, start with its [self-hosting quickstart](https://openship.io/docs/getting-started/quickstart). For other hosts, see [Self-host a Farm.js app](https://farmjs.dev/docs/deployment#self-host-a-farmjs-app).
