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

# Install with Docker

> How to self-host Feedbase using Docker

<Warning>Docker support is currently still not fully stable. Contributions via pull requests or issues are very welcome and appreciated.</Warning>

## Create a new Supabase project

<Tip> You can also self-host Supabase on your own infrastructure. [Learn more](https://supabase.io/docs/guides/self-hosting).</Tip>

You'll need a Supabase account to get started. [Sign up](https://supabase.com/dashboard/sign-in) if you don't have one already.

Once you've signed up, create a new project. You can do this by clicking on the "New Project" button or by following [this link](https://supabase.com/dashboard/new/_).

### Migrate your database

Once you've created a new project, you'll need to migrate your database. You can do this the following ways:

<Accordion title="Using Supafork (Recommended)">
  Click [here](https://supafork.com/new?repository_url=https://github.com/chroxify/feedbase) and follow the instructions to fork the Feedbase repository and migrate your database automatically.
</Accordion>

<Accordion title="Using the Supabase CLI">
  For this method, you'll need to install the Supabase CLI. View the installation instructions [here](https://github.com/supabase/cli?tab=readme-ov-file#install-the-cli).

  <Steps>
    <Step title="Clone the Feedbase repository">
      ```bash theme={null}
      git clone https://github.com/chroxify/feedbase.git && cd feedbase
      ```
    </Step>

    <Step title="Login to Supabase">
      ```bash theme={null}
      supabase login
      ```
    </Step>

    <Step title="Link your project">
      ```bash theme={null}
      supabase link --project-ref <project-id>
      ```

      You can find your project ID in the URL of your Supabase project dashboard or via runnning `supabase projects list`.
    </Step>

    <Step title="Run the migrations">
      ```bash theme={null}
      supabase db push
      ```
    </Step>
  </Steps>

  If everything went successful, you should be able to see a populated database in your Supabase dashboard.
</Accordion>

<Accordion title="Manually using the SQL Editor">
  <Steps>
    <Step title="Go to your Project's SQL Editor">
      Click on the SQL tab in your project dashboard or follow [this link](https://supabase.com/dashboard/project/_/sql/new).
    </Step>

    <Step title="Run the migrations">
      Copy and paste all the contents of each file in the [`supabase/migrations`](https://github.com/chroxify/feedbase/tree/main/supabase/migrations) folder of the Feedbase repository into the SQL editor and run them.
    </Step>

    <Step title="Verify the migrations">
      If everything went successful, you should be able to see a populated database in your Supabase dashboard.
    </Step>
  </Steps>
</Accordion>

## Prepare your environment variables

Once you've migrated your database, you'll need to prepare all necessary environment variables for the next step.

You can find a list of all environment variables and where to find them [here](https://github.com/chroxify/feedbase/blob/main/.env.example).

## Installation

1. Clone the Feedbase repository.

```bash theme={null}
git clone https://github.com/chroxify/feedbase.git && cd feedbase
```

2. Create a `.env` file.

```bash theme={null}
cp .env.example .env
```

3. Update the `.env` file with your environment variables.

4. Either run the pre-built Docker image or build and run the Docker image yourself.

<Accordion title="Run using pre-built Docker image (Recommended)">
  <Steps>
    <Step title="Pull the Docker image">
      ```bash theme={null}
      docker pull chroxify/feedbase
      ```
    </Step>

    <Step title="Run the Docker image">
      <Note>If you don't want to run the container in detached mode, you can remove the `-d` flag.</Note>

      ```bash theme={null}
      docker run -d --env-file .env -p 3000:3000 chroxify/feedbase
      ```
    </Step>

    <Step title="Verify the installation">
      If everything went successful, you should be able to see a running Feedbase instance by visiting `http://localhost:3000` in your browser.
    </Step>
  </Steps>
</Accordion>

<Accordion title="Build and run the Docker image">
  <Steps>
    <Step title="Build the Docker image">
      ```bash theme={null}
      docker build -f apps/web/Dockerfile -t feedbase .
      ```
    </Step>

    <Step title="Run the Docker image">
      <Note>If you don't want to run the container in detached mode, you can remove the `-d` flag.</Note>

      ```bash theme={null}
      docker run -d --env-file .env -p 3000:3000 feedbase
      ```
    </Step>

    <Step title="Verify the installation">
      If everything went successful, you should be able to see a running Feedbase instance by visiting `http://localhost:3000` in your browser.
    </Step>
  </Steps>
</Accordion>
