Education

Self-Hosting GudDesk: A Complete Guide

Everything you need to know about running GudDesk on your own infrastructure — from Docker to bare metal.

Self-Hosting GudDesk: A Complete Guide

One of GudDesk's core principles is that you should own your data. Self-hosting makes that a reality. This guide walks you through everything you need to run GudDesk on your own infrastructure.

Prerequisites

Before you start, you'll need:

  • Docker and Docker Compose (recommended) or Node.js 20+
  • PostgreSQL 15+ (or use the bundled Docker container)
  • A domain name (for the chat widget and dashboard)
  • An SMTP service (Resend, SendGrid, or any SMTP provider for transactional emails)

Quick Start with Docker

The fastest way to get GudDesk running is with Docker Compose:

# Clone the repository
git clone https://github.com/guddesk/guddesk.git
cd guddesk
 
# Copy the environment template
cp .env.example .env
 
# Edit .env with your configuration
# At minimum, set DATABASE_URL, AUTH_SECRET, and RESEND_API_KEY
 
# Start everything
docker compose up -d

That's it. GudDesk will be running at http://localhost:3000 with a PostgreSQL database.

Environment Variables

Here are the key environment variables you'll need to configure:

VariableRequiredDescription
DATABASE_URLYesPostgreSQL connection string
AUTH_SECRETYesRandom secret for session encryption
RESEND_API_KEYYesFor transactional emails
NEXT_PUBLIC_APP_URLYesYour public-facing URL
GOOGLE_CLIENT_IDYesFor Google OAuth sign-in
GOOGLE_CLIENT_SECRETYesFor Google OAuth sign-in
PUSHER_APP_IDNoFor real-time messaging
ANTHROPIC_API_KEYNoFor AI agent features

Running Without Docker

If you prefer running directly on your server:

# Install dependencies
pnpm install
 
# Run database migrations
pnpm db:push
 
# Build the application
pnpm build
 
# Start production server
pnpm start

We recommend using a process manager like PM2 to keep GudDesk running:

pm2 start pnpm --name guddesk -- start

Setting Up the Chat Widget

Once your instance is running, embed the chat widget on your site:

<script>
  window.GudDeskSettings = {
    appId: "gd_pub_xxxxxxxxxxxxxxxx",
    baseUrl: "https://your-guddesk-domain.com"
  };
</script>
<script src="https://your-guddesk-domain.com/widget.js" async></script>

You can find your App ID (prefixed gd_pub_) in the dashboard under Settings > Widget. This value is safe to include in client-side code — it only identifies your workspace.

Database Backups

Since you own the database, you're responsible for backups. We recommend:

# Daily automated backup
pg_dump $DATABASE_URL > backup-$(date +%Y%m%d).sql

Set this up as a cron job or use your cloud provider's managed backup service.

Updating

To update your self-hosted instance:

# Pull the latest changes
git pull origin main
 
# Install any new dependencies
pnpm install
 
# Run migrations
pnpm db:push
 
# Rebuild and restart
pnpm build
pm2 restart guddesk

Reverse Proxy Setup

For production, put GudDesk behind a reverse proxy like Nginx or Caddy:

server {
    listen 443 ssl;
    server_name support.yourdomain.com;
 
    ssl_certificate /path/to/cert.pem;
    ssl_certificate_key /path/to/key.pem;
 
    location / {
        proxy_pass http://localhost:3000;
        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-Real-IP $remote_addr;
    }
}

Need Help?

If you run into issues:

  • Check the documentation for detailed configuration guides
  • Open an issue on GitHub
  • Join the community discussions

Self-hosting gives you complete control over your customer data and infrastructure. It's a bit more work upfront, but the peace of mind is worth it.