Back to articles
Technology Insight

Self-Hosting Chatwoot with PostgreSQL on a VPS: The Ultimate Guide to Open-Source Omnichannel Customer Support

May 30, 2026

Introduction: The Case for Self-Hosted Omnichannel Support

In the modern digital marketplace, managing customer communication across multiple channels—such as live chat, email, WhatsApp, Facebook, and X (formerly Twitter)—is a critical operational necessity. While proprietary, cloud-based customer relationship management (CRM) and helpdesk platforms offer convenience, they often come with escalating subscription fees, restrictive data silos, and vendor lock-in. For businesses prioritizing data sovereignty, compliance, and cost efficiency, self-hosting is the definitive alternative.

Chatwoot has emerged as a leading open-source, omnichannel customer engagement platform that rivals proprietary alternatives like Intercom and Zendesk. By self-hosting Chatwoot on a Virtual Private Server (VPS) combined with a robust PostgreSQL database, your enterprise gains full ownership of customer interactions, slashes monthly software overheads, and ensures strict adherence to data privacy regulations such as GDPR or HIPAA. This technical guide delivers a step-by-step roadmap to deploying Chatwoot successfully in your own infrastructure.

---

Why Pair Chatwoot with PostgreSQL on a VPS?

Before diving into the deployment phase, it is vital to understand why this specific architectural stack is highly recommended for production environments:

  • Data Privacy and Security: All customer conversations, contact details, and internal team notes remain entirely under your control, hosted on your secure infrastructure.
  • Uncompromised Performance: Running Chatwoot on a dedicated VPS prevents the latency and noisy-neighbor issues common in shared hosting environments.
  • PostgreSQL Reliability: Chatwoot relies heavily on PostgreSQL as its primary relational database management system. It provides advanced data integrity, supports complex queries, and handles concurrent connections exceptionally well under high chat volumes.
  • Cost Predictability: Instead of paying per-agent licensing fees, your costs are limited to predictable monthly or hourly VPS infrastructure billing.
---

Prerequisites and System Requirements

To ensure a smooth installation process, verify that your environment meets the following baseline technical criteria:

  1. Virtual Private Server (VPS): A minimum of 2 vCPUs, 4GB RAM, and 40GB SSD storage. Ubuntu 22.04 LTS or Ubuntu 24.04 LTS is the preferred operating system for stability.
  2. Domain Name: A fully qualified domain name (FQDN) configured with an A Record pointing directly to your VPS public IP address (e.g., chat.yourcompany.com).
  3. SMTP Credentials: An external email service provider (such as SendGrid, Mailgun, or Amazon SES) to handle transactional emails, system notifications, and agent invitations.
---

Step 1: Preparing Your VPS and Operating System

Begin by securing and updating your server. Connect to your VPS via SSH as a root user or a user with sudo privileges, then execute the following commands to update the system repository lists and upgrade existing packages:

sudo apt update && sudo apt upgrade -y

Next, install essential system utilities, including curl, git, and software-properties-common, which will facilitate the setup script execution:

sudo apt install -y curl git software-properties-common
---

Step 2: Database Setup – Optimizing PostgreSQL

While Chatwoot offers a deployment script that can bundle a local PostgreSQL instance, enterprise setups often benefit from explicitly configuring PostgreSQL to ensure proper database user access controls, backups, and tuning.

Install PostgreSQL along with its contrib packages:

sudo apt install -y postgresql postgresql-contrib

Once installed, access the PostgreSQL prompt to create a dedicated user and database specifically for Chatwoot. Replacing YourSecurePassword with a strong, complex credential is highly recommended:

sudo -i -u postgres psql
CREATE DATABASE chatwoot_production;
CREATE USER chatwoot WITH ENCRYPTED PASSWORD 'YourSecurePassword';
GRANT ALL PRIVILEGES ON DATABASE chatwoot_production TO chatwoot;
\q
---

Step 3: Installing Chatwoot via Official Deployment Script

The Chatwoot team maintains an official deployment script for Ubuntu that automates the installation of Ruby, Node.js, Redis, and necessary dependencies. Download and run the installation script using the command below:

mkdir -p ~/.chatwoot && cd ~/.chatwoot
wget [https://get.chatwoot.app/linux/install.sh](https://get.chatwoot.app/linux/install.sh)
chmod +x install.sh
sudo ./install.sh master web

During the script execution, the interactive installer will prompt you for configuration details. When asked for the database details, input the custom PostgreSQL database name, username, and password created in Step 2. The script will handle the schema migrations and configure Nginx as a reverse proxy automatically.

---

Step 4: Configuring SSL and Environment Variables

To safeguard customer data in transit, configuring an SSL certificate is mandatory. The deployment script integrates Certbot to fetch free Let's Encrypt SSL certificates. Provide your domain name (e.g., chat.yourcompany.com) and a valid admin email address when prompted by the script to enable HTTPS automatically.

To fine-tune your Chatwoot installation, edit the environment configuration file located at /home/chatwoot/chatwoot/.env. Ensure your SMTP settings are accurately mapped to enable outbound emails:

  • SMTP_ADDRESS: Your email provider's SMTP server host.
  • SMTP_PORT: Typically 587 for TLS.
  • SMTP_AUTHENTICATION: Set to login or plain.
  • SMTP_ENABLE_STARTTLS_AUTO: Set to true for secure transport.

After modifying the environment file, restart the Chatwoot system services to apply the new configurations:

sudo systemctl restart chatwoot.target
---

Step 5: Initializing the Administrator Account

With the infrastructure configured and the services running, navigate to your domain web browser link: [https://chat.yourcompany.com](https://chat.yourcompany.com). You will be greeted by the Chatwoot onboarding wizard.

Follow these final steps to complete the initialization:

  1. Create the primary Super Administrator account by entering your official corporate email and a secure password.
  2. Configure your initial Organization Account name.
  3. Access the dashboard and proceed to settings to build your communication channels, invite your support agents, and embed the live chat widget onto your corporate website.
---

Conclusion and Maintenance Best Practices

By hosting Chatwoot independently with a PostgreSQL database on a dedicated VPS, you have successfully built a highly resilient, cost-effective customer support center that guarantees complete data ownership. To keep your system secure, ensure you establish a regular cron-job backup schedule for your PostgreSQL database and periodically check for official Chatwoot repository updates to leverage new features and security patches. Your business is now fully equipped to deliver seamless, modern omnichannel experiences without compromise.

Self-Hosting Chatwoot with PostgreSQL on a VPS: The Ultimate Guide to Open-Source Omnichannel Customer Support | DPTCloud