# Instalação Hub Beszel

Link: [https://www.beszel.dev/guide/hub-installation](https://www.beszel.dev/guide/hub-installation)

<main class="main" data-v-e6f2a212="" id="bkmrk-hub-installation-bes"># Hub Installation

Beszel supports installation via Docker/ Podman or single binary file.

TIP

Check the [Getting Started](https://www.beszel.dev/guide/getting-started) guide if you're setting up Beszel for the first time.

## Docker or Podman

All methods will start the Beszel service on port `8090` and mount the `./beszel_data` directory for persistent storage.

<div class="vp-doc _guide_hub-installation" data-v-e6f2a212=""><div><div class="vp-code-group vp-adaptive-theme"><div class="tabs"><label data-title="docker-compose.yml" for="tab-e8FLs99">docker-compose.yml</label><label data-title="docker run" for="tab-1El870z">docker run</label><label data-title="podman run" for="tab-VDQAMeN">podman run</label></div><div class="blocks"><div class="language-yaml vp-adaptive-theme active"><button class="copy" title="Copy Code"></button></div></div></div></div></div>```
services:
  beszel:
    image: henrygd/beszel
    container_name: beszel
    restart: unless-stopped
    environment:
      - APP_URL=http://localhost:8090
    ports:
      - 8090:8090
    volumes:
      - ./beszel_data:/beszel_data
```

<div class="vp-doc _guide_hub-installation" data-v-e6f2a212=""><div><div class="vp-code-group vp-adaptive-theme"><div class="blocks"><div class="language-yaml vp-adaptive-theme active"></div></div></div><details class="details custom-block">IMPORTANT

This configuration should work out of the box, but you must follow these steps when adding the system in the web UI:

<div class="tip custom-block">1. Update the `KEY` and `TOKEN` environment variables with your public key and token, then restart the agent:

<div class="language- vp-adaptive-theme"><button class="copy" title="Copy Code"></button></div></div>```
docker compose up -d
```

<div class="tip custom-block"><div class="language- vp-adaptive-theme"></div>2. Use the unix socket path as the **Host / IP** in the web UI:

<div class="language- vp-adaptive-theme"><button class="copy" title="Copy Code"></button></div></div>```
/beszel_socket/beszel.sock
```

<div class="vp-code-group vp-adaptive-theme"><div class="tabs"><label data-title="docker-compose.yml" for="tab-p4rKvFD">docker-compose.yml</label></div><div class="blocks"><div class="language-yaml vp-adaptive-theme active"><button class="copy" title="Copy Code"></button></div></div></div>```
services:
  beszel:
    image: henrygd/beszel:latest
    container_name: beszel
    restart: unless-stopped
    environment:
      APP_URL: http://localhost:8090
    ports:
      - 8090:8090
    volumes:
      - ./beszel_data:/beszel_data
      - ./beszel_socket:/beszel_socket

  beszel-agent:
    image: henrygd/beszel-agent:latest
    container_name: beszel-agent
    restart: unless-stopped
    network_mode: host
    volumes:
      - ./beszel_agent_data:/var/lib/beszel-agent
      - ./beszel_socket:/beszel_socket
      - /var/run/docker.sock:/var/run/docker.sock:ro
    environment:
      LISTEN: /beszel_socket/beszel.sock
      HUB_URL: http://localhost:8090
      TOKEN: <token>
      KEY: "<key>"
```

</details><details class="details custom-block">NOTE

If you prefer to set up containers in a different way, please feel free to do so.

1. Install [Docker](https://docs.docker.com/engine/install/) and [Docker Compose](https://docs.docker.com/compose/install/) if you haven't already.
2. Copy the `docker-compose.yml` content.
3. Create a directory somewhere to store the `docker-compose.yml` file.

```
mkdir beszel
cd beszel
```

4. Create a `docker-compose.yml` file, paste in the content, and save it.

<div class="vp-code-group vp-adaptive-theme"><div class="tabs"><label data-title="nano" for="tab-3QRHByX">nano</label><label data-title="vim" for="tab-Hae0amP">vim</label><label data-title="emacs" for="tab-2HpkYcI">emacs</label><label data-title="vscode" for="tab-j2OxPFc">vscode</label></div><div class="blocks"><div class="language-bash vp-adaptive-theme active"><button class="copy" title="Copy Code"></button></div></div></div>```
nano docker-compose.yml
```

5. Change the `APP_URL` environment variable to the URL you’ll use to access the Hub (for example, a domain name or public IP including port if needed)
6. Start the service.

```
docker compose up -d
```

</details></div></div>## Binary

Beszel is written in pure Go and can be easily compiled (or cross-compiled) if a prebuilt binary isn't available.

### 1. Linux / FreeBSD install script

This command downloads and runs our `install-hub.sh` script. The script installs the latest binary and creates a systemd service to keep it running after reboot.

<div class="vp-doc _guide_hub-installation" data-v-e6f2a212=""><div>- `-u` : Uninstall
- `-p <port>` : Specify a port number (default: 8090)
- `-c <url>` : Use a custom GitHub mirror URL (e.g. [https://ghfast.top/](https://ghfast.top/))
- `--auto-update`: Enable automatic daily updates
- `-h`: Show help

<div class="language-bash vp-adaptive-theme"><button class="copy" title="Copy Code"></button></div></div></div>```
curl -sL https://get.beszel.dev/hub -o /tmp/install-hub.sh && chmod +x /tmp/install-hub.sh && /tmp/install-hub.sh
```

### 2. Manual download and start (Linux, FreeBSD, others)

<div class="vp-doc _guide_hub-installation" data-v-e6f2a212=""><div><details class="details custom-block">#### Download

Download the latest binary from [releases](https://github.com/henrygd/beszel/releases) that matches your server's CPU architecture and run it manually. You will need to create a service manually to keep it running after reboot.

```
curl -sL "https://github.com/henrygd/beszel/releases/latest/download/beszel_$(uname -s)_$(uname -m | sed -e 's/x86_64/amd64/' -e 's/armv6l/arm/' -e 's/armv7l/arm/' -e 's/aarch64/arm64/').tar.gz" | tar -xz -O beszel | tee ./beszel >/dev/null && chmod +x beszel
```

#### Start the hub

```
./beszel serve --http "0.0.0.0:8090"
```

#### Update the hub

```
./beszel update
```

#### Create a service (optional)

If your system uses systemd, you can create a service to keep the hub running after reboot.

1. Create a service file in `/etc/systemd/system/beszel.service`, replacing `{/path/to/working/directory}` with the path to the working directory. A non-root user can be used if the user has write access to the working directory.

```
[Unit]
Description=Beszel Hub
After=network.target

[Service]
Type=simple
Restart=always
RestartSec=3
User=root
WorkingDirectory={/path/to/working/directory}
ExecStart={/path/to/working/directory}/beszel serve --http "0.0.0.0:8090"

[Install]
WantedBy=multi-user.target
```

2. Enable and start the service.

```
sudo systemctl daemon-reload
sudo systemctl enable beszel.service
sudo systemctl start beszel.service
```

</details></div></div>### 3. Manual compile and start (any platform)

<div class="vp-doc _guide_hub-installation" data-v-e6f2a212=""><div><details class="details custom-block">#### Compile

See [Compiling](https://www.beszel.dev/guide/compiling) for information on how to compile the hub yourself.

#### Start the hub

```
./beszel serve --http "0.0.0.0:8090"
```

#### Update the hub

```
./beszel update
```

#### Create a service (optional)

If your system uses systemd, you can create a service to keep the hub running after reboot.

1. Create a service file in `/etc/systemd/system/beszel.service`. A non-root user can be used if the user has write access to the working directory.

```
[Unit]
Description=Beszel Hub
After=network.target

[Service]
Type=simple
Restart=always
RestartSec=5
User=root
WorkingDirectory={/path/to/working/directory}
ExecStart={/path/to/working/directory}/beszel serve --http "0.0.0.0:8090"

[Install]
WantedBy=multi-user.target
```

2. Enable and start the service.

```
sudo systemctl daemon-reload
sudo systemctl enable beszel.service
sudo systemctl start beszel.service
```

</details></div></div></main><footer class="VPDocFooter" data-v-1bcd8184="" data-v-e6f2a212="" id="bkmrk-edit-this-page-on-gi"><div class="edit-info" data-v-1bcd8184=""><div class="edit-link" data-v-1bcd8184="">[Edit this page on GitHub](https://github.com/henrygd/beszel-docs/edit/main/en/guide/hub-installation.md)</div><div class="last-updated" data-v-1bcd8184="">  
</div></div>Last updated: <time data-v-1bb0c8a8="" datetime="2026-03-31T23:10:11.000Z">31/03/2026, 20:10</time>

<nav aria-labelledby="doc-footer-aria-label" class="prev-next" data-v-1bcd8184=""><span class="visually-hidden" data-v-1bcd8184="" id="bkmrk-pager">Pager</span><div class="pager" data-v-1bcd8184="">[<span class="desc" data-v-1bcd8184="">Previous page</span><span class="title" data-v-1bcd8184="">Getting Started</span>](https://www.beszel.dev/guide/getting-started)</div><div class="pager" data-v-1bcd8184="">[<span class="desc" data-v-1bcd8184="">Next page</span><span class="title" data-v-1bcd8184="">Agent Installation</span>](https://www.beszel.dev/guide/agent-installation)</div></nav></footer>