Windows Development Setup

This guide will walk you through setting up your Windows development environment for contributing to Chatwoot. We'll use Windows Subsystem for Linux 2 (WSL2) which provides the best development experience on Windows.

Requirements

You need to install the Windows Subsystem for Linux 2 (WSL2) on your Windows machine.

Prerequisites

  • Windows 10 version 2004 and higher (Build 19041 and higher) or Windows 11
  • Administrator privileges on your Windows machine

Step 1: Enable Developer Mode

The first step is to enable "Developer mode" in Windows. You can do this by opening up Settings and navigating to "Update & Security". In there, choose the tab on the left that reads "For Developers". Turn the "Developer mode" toggle on to enable it.

Step 2: Enable Windows Subsystem for Linux

Next you have to enable the Windows Subsystem for Linux. Open the "Control Panel" and go to "Programs and Features". Click on the link on the left "Turn Windows features on or off". Look for the "Windows Subsystem for Linux" option and select the checkbox next to it.

You'll also need to enable "Virtual Machine Platform" for WSL2. Make sure both checkboxes are selected:

  • ✅ Windows Subsystem for Linux
  • ✅ Virtual Machine Platform

After enabling these features, restart your computer.

Step 3: Install WSL2 and Ubuntu

  1. Open Microsoft Store and search for "Ubuntu"
  2. Install Ubuntu 22.04 LTS (or latest LTS version)
  3. Launch Ubuntu from the Start Menu

Option 2: Using Command Line

Open PowerShell as Administrator and run:

Step 4: Initial Ubuntu Setup

When you first launch Ubuntu, you'll be prompted to create a user account:

Update the system packages:

Step 5: Install Core Dependencies

You need core Linux dependencies installed in order to install Ruby and other tools.

Installing RVM & Ruby

Install additional dependencies required for RVM:

Install RVM & Ruby version 3.2.2:

Install Node.js

Chatwoot requires Node.js version 20. Install Node.js from NodeSource using the following commands:

Verify Node.js installation:

Install pnpm

We use pnpm as the package manager for better performance:

Install PostgreSQL

The database used in Chatwoot is PostgreSQL. Use the following commands to install PostgreSQL:

The installation procedure created a user account called postgres that is associated with the default Postgres role. In order to use PostgreSQL, you can log into that account:

Install libpq-dev dependencies for Ubuntu:

Start PostgreSQL service:

Configure PostgreSQL to start automatically:

Create a database user:

Install Redis Server

Chatwoot uses Redis server for agent assignments and reporting. To install redis-server:

Start Redis service:

Configure Redis to start automatically:

Enable Redis to start on system boot:

Install ImageMagick

Chatwoot uses ImageMagick for image processing:

Configure Git

Set up Git with your information:

Windows-Specific Configuration

Install VS Code with WSL Extension

  1. Install Visual Studio Code on Windows from https://code.visualstudio.com/
  2. Install Remote - WSL extension from the Extensions marketplace
  3. Open your project in WSL by running code . from your WSL terminal

Configure File Permissions

WSL2 may have file permission issues. Fix them:

Environment Verification

Verify all installations are working correctly:

Troubleshooting Common Issues

**Solution**: Ensure virtualization is enabled in BIOS and Windows features are properly enabled: 1. Restart computer and enter BIOS settings 2. Enable Intel VT-x or AMD-V virtualization 3. Enable Hyper-V in Windows Features 4. Restart and try installation again **Solution**: Reset WSL or reinstall Ubuntu: ```powershell # Reset Ubuntu (will delete all data) wsl --unregister Ubuntu-22.04 wsl --install -d Ubuntu-22.04 ``` **Solution**: Check if Windows PostgreSQL service is conflicting: ```bash # Stop Windows PostgreSQL service first (run in Windows Command Prompt as Admin) net stop postgresql-x64-14

Then start WSL2 PostgreSQL

sudo service postgresql start

**Solution**: Ensure code is stored in WSL2 filesystem: ```bash # Good: Store code here (fast) /home/username/projects/chatwoot

Avoid: Storing code here (slow)

/mnt/c/Users/Username/projects/chatwoot

Built with

Show your support! Star us on GitHub ⭐️