# Setup Guide

URL: https://zerodev.ca/docs/retrail/setup

> Install Retrail, edit settings.json and put your portfolio online.



Retrail is a Next.js app. You install it once, edit `settings.json` and run it. There is no database and no admin panel.

## Before You Start

You need:

* A host that runs **Node.js 20.9** or newer.
* The `retrail.zip` from your BuiltByBit download.
* A domain, if you want your portfolio public.

## Hosting

| Option                        | Best for                                                                          |
| ----------------------------- | --------------------------------------------------------------------------------- |
| Game panel (Pterodactyl)      | The easiest choice. The panel keeps Retrail running and gives you a file manager. |
| Linux VPS or dedicated server | Full control. Use a process manager such as PM2.                                  |
| Docker                        | Running next to other containers.                                                 |
| Your own computer             | Trying it out and editing `settings.json`.                                        |

[Haven Development](https://havendevelopment.net) hosts Retrail on Pterodactyl.

## Install

<Tabs items="[&#x22;Pterodactyl&#x22;, &#x22;Linux&#x22;, &#x22;Windows&#x22;, &#x22;Docker&#x22;]">
  <Tab value="Pterodactyl">
    1. Create a server with a Node.js 20 or newer egg.
    2. Upload and extract `retrail.zip`.
    3. Set the startup command to `npm install && npm run build && npm start -- -p {{SERVER_PORT}}`.
    4. Start the server.
  </Tab>

  <Tab value="Linux">
    1. Extract the package and open the folder:

    ```bash
    unzip retrail.zip -d retrail
    cd retrail
    ```

    2. Install and build:

    ```bash
    npm install
    npm run build
    ```

    3. Start it with PM2 so it keeps running:

    ```bash
    npm install -g pm2
    pm2 start npm --name Retrail -- start
    pm2 save
    ```
  </Tab>

  <Tab value="Windows">
    1. Extract `retrail.zip` and open PowerShell in the folder.
    2. Run `npm install`, then `npm run build`.
    3. Run `npm start`.
  </Tab>

  <Tab value="Docker">
    1. Add a `Dockerfile` to the folder:

    ```dockerfile title="Dockerfile"
    FROM node:20-alpine
    WORKDIR /app
    COPY . .
    RUN npm ci && npm run build
    EXPOSE 3000
    CMD ["npm", "start"]
    ```

    2. Build and run it, with `settings.json` mounted so you can edit it without rebuilding:

    ```bash
    docker build -t retrail .
    docker run -d --name retrail -p 3000:3000 -v "$(pwd)/settings.json:/app/settings.json" retrail
    ```
  </Tab>
</Tabs>

Open `http://localhost:3000`, or your server's address on port `3000`. To use another port, start it with `npm start -- -p 8080`.

## Configure

Set your name, colours and sections in `settings.json`. See [Configuration](/docs/retrail/configuration) and the [Page Builder](/docs/retrail/page-builder).

Retrail reads `settings.json` on every page load, so changes show up when you refresh. You do not need to rebuild or restart. The file stays on the server and is never sent to visitors.

<Callout type="warn">
  `settings.json` must be valid JSON. A missing comma or quote stops the page from loading. Paste it into a JSON validator if the page breaks after an edit.
</Callout>

## Hosting on a Domain

Point a domain at your server and put a reverse proxy in front of port `3000`. Pick yours:

<ReverseProxy sites="[{ domain: &#x22;portfolio.example.com&#x22;, port: 3000 }]" />

## Updating

1. Back up `settings.json`.
2. Extract the new version over the old folder, keeping your `settings.json`.
3. Run `npm install` and `npm run build`, then restart.

## Next

Read [Page Builder](/docs/retrail/page-builder) to add your sections.
