Skip to main content

This helpcenter is releasing soon in the next release!

Search

Installing Libredesk

Install Libredesk with Docker, from a prebuilt binary, or from source.

Libredesk can be installed with Docker, with a prebuilt binary, or by building from source. Docker is the recommended option for most setups.

Libredesk runs on port 9000 by default. After installation, log in at http://localhost:9000 with the email System and the password you set.

Install with Docker

This is the recommended way to run Libredesk. You only need Docker and Docker Compose. Postgres and Redis come with the compose file.

1. Download the compose file and the sample config.

curl -LO https://github.com/abhinavxd/libredesk/raw/main/docker-compose.yml
curl -LO https://github.com/abhinavxd/libredesk/raw/main/config.sample.toml

2. Copy the sample config and edit it as needed.

cp config.sample.toml config.toml

3. Start the services.

docker compose up -d

4. Set the password for the System user.

docker exec -it libredesk_app ./libredesk --set-system-user-password

Open http://localhost:9000 and log in as System.

Install from a binary

You need PostgreSQL 13 or newer and Redis running already.

1. Download the latest release binary for your platform from the releases page.

2. Download the sample config and copy it.

curl -LO https://github.com/abhinavxd/libredesk/raw/main/config.sample.toml
cp config.sample.toml config.toml

3. Create the uploads directory.

mkdir uploads
chmod 755 uploads

4. Install the database tables.

./libredesk --install

You can also set the System user password during install.

LIBREDESK_SYSTEM_USER_PASSWORD=your_password ./libredesk --install

5. Set the System user password, if you did not set it above.

./libredesk --set-system-user-password

6. Run Libredesk.

./libredesk

Build from source

You need PostgreSQL 13 or newer, Redis, a recent Go, Node.js 18 or newer, and pnpm.

1. Clone the repository.

git clone [email protected]:abhinavxd/libredesk.git
cd libredesk

2. Build the application.

make

3. Download the sample config and copy it.

curl -LO https://github.com/abhinavxd/libredesk/raw/main/config.sample.toml
cp config.sample.toml config.toml

4. Create the uploads directory.

mkdir uploads
chmod 755 uploads

5. Install the database tables and set the System user password.

./libredesk --install
./libredesk --set-system-user-password

6. Run Libredesk.

./libredesk

Configuration with environment variables

Every setting in config.toml can be set with an environment variable instead. Use the LIBREDESK_ prefix and two underscores for nested keys.

LIBREDESK_DB__HOST=localhost

Running behind nginx

A reverse proxy is recommended in production. Install nginx first.

sudo apt update && sudo apt install nginx

On Fedora or RHEL:

sudo dnf install nginx && sudo systemctl enable --now nginx

Then use a config like this.

server {
    listen 80;
    server_name your-domain.com;
    client_max_body_size 30M;

    location / {
        proxy_pass http://localhost:9000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;

        proxy_set_header X-Client-IP $remote_addr;
        # If behind Cloudflare (or another CDN), forward the CDN's real-client header
        # instead, AND firewall nginx to only accept connections from the CDN's IP range,
        # otherwise clients can bypass the CDN and spoof this header directly.

        # proxy_set_header X-Client-IP $http_cf_connecting_ip;   # Cloudflare

        proxy_cache_bypass $http_upgrade;
    }
}

The proxy must set X-Client-IP to $remote_addr. Rate limiting and audit logs read the client IP from that header.

Enable the site and reload nginx.

sudo ln -s /etc/nginx/sites-available/libredesk /etc/nginx/sites-enabled/
sudo nginx -t && sudo systemctl reload nginx

Was this article helpful?