---
title: "Deploy needline"
description: "Open source self-hostable customer portal built on Linear"
category: "Other"
url: https://railway.com/deploy/needline
---

# Deploy needline

Open source self-hostable customer portal built on Linear

**[Deploy needline on Railway](https://railway.com/template/needline)**

- **Creator:** Flowers
- **Category:** Other
- **Total deploys:** 1

## Template content

### needline https://needline.princhman.com/logo.svg

- **Source:** princhman/needline

## Documentation

# Deploy and Host needline on Railway

Open source self-hostable customer portal built on Linear.  

## About Hosting needline

### 1. Create Linear app 
a. Choose your name, enter other fields

b. In `Linear -> Setttings -> API` you can create application, with redirect URI - `{base_url}/callback`

c. Enable client credentials

d. After app creation, save `Client ID` and `Client Secret`, they will go under `PUBLIC_CLIENT_ID`, `CLIENT_TOKEN` as environment variables respectively.

### 2. Create encryption keys
a. Keys for encryption of cookies and file can be generated with 
```bash
openssl rand -hex 32
```
(you need 2 32 bytes keys), they will go under `COKIE_ENCRYPTION_KEY` and `STORE_FILE_ENCRYPTION_KEY` as environment variables respectively.

b. For JWT encryption you can run 
```bash
# private key
openssl genrsa -out private.pem 2048

# extract public key
openssl rsa -in private.pem -pubout -out public.pem
```

You wil use private on you company website to encrypt user data, and public should go under `JWT_ENCRYPTION_PUBLIC_KEY` as environment variable.

### 3. Create customer Authentication

> more about how it works you can read [here](https://github.com/princhman/needline)

a. Get your auth url under `AUTH_URL` environment variable, user will be redirected there with `callback_url` set to `{base_url}/callback/company`

b. When user is authenticated on your side, they need to be redirected to `callback_url` with `user` parameter set to encrypted, with earlier generated private key, stringified user json.

## Common Use Cases

- Customer portal to submit requests

- Customer up voting requests to make it easy for developer to choose

- Feedback portal

- Feedback feed into Linear


## Dependencies for needline Hosting

- Linear 

### Deployment Dependencies



### Implementation Details
Example of auth implementation
```ts
import { constants, privateEncrypt } from "node:crypto";

type User = {
  email: string;
  name: string;
  company: string;
};

const encrypt = (user: User, key: string) => {
  return privateEncrypt(
    {
      key: privateKey,
      padding: constants.RSA_PKCS1_PADDING,
    },
    Buffer.from(JSON.stringify(user), "utf8"),
  );
};
```

## Why Deploy needline 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.

By deploying needline on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.

## Similar templates

- [Rocky Linux](https://railway.com/deploy/rocky-linux) — [Jul'26] Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀
- [Foundry Virtual Tabletop](https://railway.com/deploy/X5tR6G) — A Self-Hosted & Modern Roleplaying Platform
- [Letta Code Remote](https://railway.com/deploy/letta-code-remote) — Run a Letta Code agent 24/7. No inbound ports, just deploy.

Open this page in a browser: https://railway.com/deploy/needline
