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.
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.
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.
The database used in Chatwoot is PostgreSQL. Use the following commands to install PostgreSQL:
Copy
sudo apt install -y postgresql postgresql-contrib
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:
Copy
sudo -u postgres psql
Install libpq-dev dependencies for Ubuntu:
Copy
sudo apt-get install -y libpq-dev
Start PostgreSQL service:
Copy
sudo service postgresql start
Configure PostgreSQL to start automatically:
Copy
echo 'sudo service postgresql start' >> ~/.bashrc
Create a database user:
Copy
# Switch to postgres user and create a superusersudo -u postgres createuser --superuser $USER# Set password for your user sudo -u postgres psql -c "ALTER USER $USER PASSWORD 'password';"
# Check all versionsruby --version # Should be 3.2.2node --version # Should be v20.x.xpnpm --version # Should show pnpm versionpsql --version # Should show PostgreSQL versionredis-cli ping # Should output: PONGconvert --version # Should show ImageMagick versiongit --version # Should show Git version
Solution: Check if Windows PostgreSQL service is conflicting:
Copy
# Stop Windows PostgreSQL service first (run in Windows Command Prompt as Admin)net stop postgresql-x64-14# Then start WSL2 PostgreSQLsudo service postgresql start
Solution: Fix file permissions:
Copy
# For the entire projectfind . -type f -exec chmod 644 {} \;find . -type d -exec chmod 755 {} \;# For executable fileschmod +x bin/*
Solution: Ensure code is stored in WSL2 filesystem:
Copy
# Good: Store code here (fast)/home/username/projects/chatwoot# Avoid: Storing code here (slow)/mnt/c/Users/Username/projects/chatwoot