> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/discordplace/discord.place/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Clone and install discord.place on your own server.

This guide walks you through cloning the repository, installing dependencies, and starting both the server and the client.

<Note>
  Make sure you have completed all the steps in [Prerequisites](/self-hosting/prerequisites) before continuing.
</Note>

<Steps>
  <Step title="Clone the repository">
    Clone the discord.place repository to your local machine:

    ```bash theme={null}
    git clone https://github.com/discordplace/discord.place.git
    ```
  </Step>

  <Step title="Navigate to the repository">
    Move into the cloned directory:

    ```bash theme={null}
    cd discord.place
    ```
  </Step>

  <Step title="Install server dependencies">
    Install the Node.js dependencies for the server:

    ```bash theme={null}
    cd server
    npm install
    ```
  </Step>

  <Step title="Install client dependencies">
    Install the Node.js dependencies for the client:

    ```bash theme={null}
    cd ../client
    npm install
    ```
  </Step>

  <Step title="Create environment files">
    Create a `.env` file in both the `server` and `client` directories. You can use the example files as a starting point:

    ```bash theme={null}
    cp server/.example.env server/.env
    cp client/.example.env client/.env
    ```

    Fill in the values for each file. See the [Configuration overview](/self-hosting/configuration) for guidance on what each variable does.

    <Note>
      The `CLIENT_SECRET` value must be identical in both `server/.env` and `client/.env`. This shared secret is used by the server to verify requests coming from the client's server-side rendering. You can use any random string, but it must match exactly on both sides.
    </Note>
  </Step>

  <Step title="Start the server">
    From the repository root, start the Express.js server:

    ```bash theme={null}
    cd server
    npm start
    ```

    The server listens on port `3001` by default.
  </Step>

  <Step title="Start the client">
    In a separate terminal, start the Next.js client in development mode:

    ```bash theme={null}
    cd client
    npm run dev
    ```

    The client listens on port `3000` by default.
  </Step>

  <Step title="Open the site">
    Open your browser and navigate to:

    ```
    http://localhost:3000
    ```

    You should see the discord.place homepage running locally.
  </Step>
</Steps>

## Next steps

Once the site is running, configure your Discord application, storage, and other services:

<CardGroup cols={2}>
  <Card title="Configuration overview" icon="gear" href="/self-hosting/configuration">
    Understand how the `.env` files and config files relate to each other.
  </Card>

  <Card title="Client environment variables" icon="file" href="/self-hosting/env-client">
    Full reference for every variable in `client/.env`.
  </Card>

  <Card title="Server environment variables" icon="file" href="/self-hosting/env-server">
    Full reference for every variable in `server/.env`.
  </Card>

  <Card title="Server config.yml" icon="settings" href="/self-hosting/config-server">
    Reference for `server/config.yml` application settings.
  </Card>
</CardGroup>
