> ## Documentation Index
> Fetch the complete documentation index at: https://docwrite.jooj.us/llms.txt
> Use this file to discover all available pages before exploring further.

# Deploy on PaaS (Render, Railway, Heroku)

> A complete guide to deploying the NexWrite - Medium-style blogging platform script on popular PaaS providers, including setup, license activation, and database configuration.

Welcome to the NexWrite PaaS Deployment Guide. This step-by-step tutorial will help you deploy and configure the NexWrite script on popular Platform-as-a-Service (PaaS) providers such as **Render**, **Railway**, and **Heroku**.

<Note>
  This guide assumes that your script is uploaded to a **private GitHub repository**. This is the recommended method to deploy on Render, Railway, and Heroku.
</Note>

***

## Prerequisites

Before proceeding, make sure you have:

* A **private GitHub repository** with the **NexWrite** script uploaded (unzip and push it to GitHub)
* An account on one of the supported PaaS platforms: **Render**, **Railway**, or **Heroku**
* **Node.js** version 18 or later
* A **MongoDB** database (e.g., via [MongoDB Atlas](https://www.mongodb.com/cloud/atlas))
* Your **NexWrite license key**
* Basic knowledge of working with Git and the terminal

***

## Step 1: Upload Your Script to GitHub

1. Unzip the NexWrite archive.
2. Push the contents to a new **private GitHub repository**:

<CodeBlock language="bash">
  git init
  git remote add origin [https://github.com/your-username/your-private-repo.git](https://github.com/your-username/your-private-repo.git)
  git add .
  git commit -m "Initial commit for NexWrite"
  git push -u origin master
</CodeBlock>

<Note>
  Make sure your GitHub repository is private if you're distributing commercial code.
</Note>

***

## Step 2: Connect GitHub to Your PaaS Provider

### 📦 Render

1. Go to your [Render dashboard](https://dashboard.render.com/).
2. Click **New +** → **Web Service**.
3. Choose **Deploy from GitHub** and connect your GitHub account.
4. Select your **NexWrite private repo**.
5. Set the following values:
   * **Environment**: `Node`
   * **Build Command**: `npm install`
   * **Start Command**: `npm start`
6. Click **Advanced** and add the following environment variables (optional — can also be entered during installation):
   * `LICENSE_KEY`
   * `DOMAIN`
   * `MONGO_DB_URI`
   * `JWT_SECRET`
7. Click **Create Web Service** to deploy.

### 🚆 Railway

1. Visit [railway.app](https://railway.app) and log in.
2. Click **New Project** → **Deploy from GitHub Repo**.
3. Select your NexWrite repository.
4. Add environment variables (optional — handled during install):
   * `LICENSE_KEY`
   * `DOMAIN`
   * `MONGO_DB_URI`
   * `JWT_SECRET`
5. Click **Deploy Project**.

### ☁️ Heroku

1. Go to [heroku.com](https://heroku.com) and log in.
2. Create a new **app**.
3. Connect your GitHub account under **Deploy** tab.
4. Search for your NexWrite private repo and click **Connect**.
5. Scroll to **Manual Deploy** and click **Deploy Branch**.
6. Under **Settings → Config Vars**, you can add:
   * `LICENSE_KEY`
   * `DOMAIN`
   * `MONGO_DB_URI`
   * `JWT_SECRET`

<Note>
  Heroku no longer offers a free tier. You must upgrade your account to deploy successfully.
</Note>

***

## Step 3: Wait for Build to Finish

Once your platform finishes building and starts the server:

1. Visit your live app URL
2. You should see the **NexWrite Installation Wizard**

<CodeBlock language="txt">
  [https://your-app-domain/install](https://your-app-domain/install)
</CodeBlock>

***

## Step 4: Complete the Installation Wizard

<Steps>
  <Step title="License Activation">
    * Enter your NexWrite license key.
    * If you’ve lost it, you can retrieve it from [https://pay.jooj.us/](https://pay.jooj.us/) using your purchase email.
  </Step>

  <Step title="Database Configuration">
    * Paste your MongoDB connection string.

      **A. MongoDB Atlas (recommended):**

      ```bash theme={null}
      mongodb+srv://<user>:<pass>@<cluster>.mongodb.net/<db>?retryWrites=true&w=majority
      ```

      *(Replace `<user>`, `<pass>`, `<cluster>`, and `<db>` with your actual values.)*

      **B. Self-hosted MongoDB:**

      ```bash theme={null}
      mongodb://localhost:27017/your-database
      ```

    * Generate or paste your JWT secret key.
  </Step>

  <Step title="Create Admin">
    * Set admin name, email, username, and password.
    * After saving, the server will automatically restart and your admin panel will be ready.
  </Step>
</Steps>

***

## After Deployment

Once the installation is complete, your site is live and ready.

* Visit your site:
  <CodeBlock language="txt">
    [https://your-app-domain](https://your-app-domain)
  </CodeBlock>

* Log in with your administrator credentials.

<Tip>
  Need to update the code? Push changes to GitHub and redeploy from your PaaS dashboard.
</Tip>

***

## Need Help?

If you run into any issues:

* Check the [Troubleshooting Guide](/get-started/installation/troubleshooting)
* Or contact us at [support@jooj.us](mailto:support@jooj.us)
