# Getting Started

::alert{type="danger"}
Nestri is in a **very early-beta phase**, so errors and bugs may occur.
::

### Step 0: Construct Your Docker Image
Checkout your branch with the latest version of nestri and build the image `<your-nestri-image>` within git root folder:
```bash
docker buildx build -t <your-nestri-image>:latest -f Containerfile.runner .
```

::alert{type="info"}
You can right now also pull the docker image from DatHorse GitHub Containter Registry with:
```bash
docker pull ghcr.io/datcaptainhorse/nestri-cachyos:latest
```
::

### Step 1: Navigate to Your Game Directory
First, change your directory to the location of your `.exe` file. For Steam games, this typically means:
```bash
cd $HOME/.steam/steam/steamapps
ls -la .
```
### Step 2: Generate a Session ID
Create a unique session ID using the following command:
```bash
echo "$(head /dev/urandom | LC_ALL=C tr -dc 'a-zA-Z0-9' | head -c 16)"
```
This command generates a random 16-character string. Be sure to note this string carefully, as you'll need it for the next step.
### Step 3: Launch the Nestri Server
With your SESSION_ID ready, insert it into the command below, replacing `<your_session_id>` with your actual session ID, also replace `<relay_url>` with your relay URL and `<your-nestri-image>` with your build nestri image or nestri remote image. Then run the command to start the Nestri server:

```bash
docker run --rm -it --shm-size=1g --gpus all -e NVIDIA_DRIVER_CAPABILITIES=all --runtime=nvidia -e RELAY_URL='<relay_url>' -e NESTRI_ROOM=<your_session_id> -e RESOLUTION=1920x1080 -e FRAMERATE=60 -e NESTRI_PARAMS='--verbose=true --video-codec=h264 --video-bitrate=4000 --video-bitrate-max=6000'--name nestri -d -v "$(pwd)":/mnt/game/ <your-nestri-image>:latest
```

### Step 4: Get Into your container
Get into your container to start your game:
```bash
sudo docker exec -it nestri bash
```
### Step 5: Installing a Launcher
For most games that are not DRM free you need a launcher. In this case use the umu launcher and optional mangohud:
```bash
pacman -S --overwrite="*" umu-launcher mangohud
```

### Step 5: Running Your Game
You have to execute your game now with nestri user. If you have a linux game just execute it with the nestri user
```bash
su nestri
source /etc/nestri/envs.sh
GAMEID=0 PROTONPATH=GE-Proton mangohud umu-run /mnt/game/<your-game.exe>
```

### Step 6: Begin Playing
Finally, construct the play URL with your session ID:
`https://nestri.io/play/<your_session_id>`

Navigate to this URL in your browser, click on the page to capture your mouse pointer, and start playing!

::alert{type="info"}
You can also use other relays/frontends depending on your choosen `<relay_url>`
For testing you can use DatHorse Relay and Frontend:

| **Placeholder**                      | **URL**   |
| ---------------------------- | ---------- |
| `<relay_url>`              | `https://relay.dathorse.com/`   |
| `<frontend_url>`           | `https://nestritest.dathorse.com/play/<your_session_id>` |
::




<!--
Nestri Node is easy to install using the provided installation script. Follow the steps below to get started.

 ## Installation

1. Download the installation script using `wget`:

```bash
wget https://github.com/nestriness/nestri/nestri-node-install.sh

```

2. Make the script executable:
```bash
chmod +x nestri-node-install.sh


```
3. Run the script to start the installation process:
```bash
./nestri-node-install.sh
```
::-->


