Compare commits

...
4 Commits
211 changed files with 10411 additions and 91 deletions
@@ -0,0 +1,264 @@
---
title: Environment Variables
description: Complete reference for Chatwoot environment variables and configuration options
sidebarTitle: Environment Variables
---
## The .env File
We use the `dotenv-rails` gem to manage the environment variables. There is a file called `env.example` in the root directory of this project with all the environment variables set to empty values. You can set the correct values as per the following options. Once you set the values, you should rename the file to `.env` before you start the server.
## Configure frontend URL (domain)
Provide your chatwoot domain as frontend URL.
```bash
FRONTEND_URL='https://your-chatwoot-domain.tld'
```
## Rails production variables
For production deployment, you have to set the following variables
```bash
RAILS_ENV=production
SECRET_KEY_BASE=replace_with_your_own_secret_string
```
You can generate `SECRET_KEY_BASE` using `rake secret` command from the project root folder. If you dont have rails installed, use `head /dev/urandom | tr -dc A-Za-z0-9 | head -c 63 ; echo ''`.
<Note>
SECRET_KEY_BASE should be alphanumeric. Avoid special characters or symbols.
</Note>
## Database configuration
Postgres can be configured in two ways: via `DATABASE_URL` or setting up independent Postgres variables.
### Configure Postgres
Set the `DATABASE_URL` variable with value as Postgres connection URI to connect to the database.
The URI is of the format
```bash
postgresql://[user[:password]@][netloc][:port][,...][/dbname][?param1=value1&...]
```
Or you can set the following environment variables to configure Postgres. Replace the values here with yours. Skip this
if you have configured `DATABASE_URL`.
```bash
POSTGRES_HOST=localhost
POSTGRES_PORT=5432
POSTGRES_DATABASE=chatwoot_production
POSTGRES_USERNAME=admin
POSTGRES_PASSWORD=password
```
### Configure Redis
For development, you can use the following URL to connect to Redis. For production, configure your Redis URL.
```bash
REDIS_URL='redis://127.0.0.1:6379'
```
To authenticate Redis connections made by the app server and sidekick, if it's protected by a password, use the following environment variable to set the password.
```bash
REDIS_PASSWORD=
```
## Configure emails
For development, you don't need an email provider. Chatwoot uses the [letter-opener](https://github.com/ryanb/letter_opener) gem to test emails locally
For production use, please configure the following variables.
```bash
# could user either `email@yourdomain.com` or `BrandName <email@yourdomain.com>`
MAILER_SENDER_EMAIL=
```
and based on your SMTP server the following variables
```bash
SMTP_ADDRESS=
SMTP_USERNAME=
SMTP_PASSWORD=
SMTP_TLS=
SMTP_SSL=
```
### Postfix
Follow these steps if you want to use a selfhosted mail server with Chatwoot. This is the default behavior starting from `v2.12.0` and relies on `SMTP_ADDRESS` environment variable not being set.
```
sudo apt install -y postfix
```
Choose internet-site when prompted and enter the domain name you used with Chatwoot setup for `System mail name`.
<Note>
By default, all major cloud provider have blocked port 25 used for sending emails as part of their spam combat effects. Please raise a support ticket with your cloud provider to enable outbound access on port 25 for this to work. Refer [AWS](https://aws.amazon.com/premiumsupport/knowledge-center/ec2-port-25-throttle), [GCP](https://cloud.google.com/compute/docs/tutorials/sending-mail), [Azure](https://learn.microsoft.com/en-us/azure/virtual-network/troubleshoot-outbound-smtp-connectivity) and [DigitalOcean](https://www.digitalocean.com/blog/smtp-restricted-by-default) for more details.
</Note>
Also please add MX and PTR records for your domain. If your emails are being flagged by `Gmail` and `Outlook`, setup [SPF and DKIM records](https://www.linuxbabe.com/mail-server/setting-up-dkim-and-spf) for your domain as well. This should improve your email reputation.
### Amazon SES
```bash
SMTP_ADDRESS=email-smtp.<region>.amazonaws.com
SMTP_AUTHENTICATION=plain
SMTP_ENABLE_STARTTLS_AUTO=true
SMTP_USERNAME=<Your SMTP username>
SMTP_PASSWORD=<Your SMTP password>
```
### SendGrid
<Info>
For clarification, the `SMTP_USERNAME` should be set to the literal text apikey—this is not the actual API key. SendGrid uses 'apikey' as the standard username for its services.
</Info>
```bash
SMTP_ADDRESS=smtp.sendgrid.net
SMTP_AUTHENTICATION=plain
SMTP_DOMAIN=<your verified domain>
SMTP_ENABLE_STARTTLS_AUTO=true
SMTP_PORT=587
SMTP_USERNAME=apikey
SMTP_PASSWORD=<your Sendgrid API key>
```
### MailGun
```bash
SMTP_ADDRESS=smtp.mailgun.org
SMTP_AUTHENTICATION=plain
SMTP_DOMAIN=<Your domain, this has to be verified in Mailgun>
SMTP_ENABLE_STARTTLS_AUTO=true
SMTP_PORT=587
SMTP_USERNAME=<Your SMTP username, view under Domains tab>
SMTP_PASSWORD=<Your SMTP password, view under Domains tab>
```
### Mandrill
If you would like to use Mailchimp to send your emails, use the following environment variables:
<Note>
Mandrill is the transactional email service for Mailchimp. You need to enable transactional email and login to mandrillapp.com.
</Note>
```bash
SMTP_ADDRESS=smtp.mandrillapp.com
SMTP_AUTHENTICATION=plain
SMTP_DOMAIN=<Your verified domain in Mailchimp>
SMTP_ENABLE_STARTTLS_AUTO=true
SMTP_PORT=587
SMTP_USERNAME=<Your SMTP username displayed under Settings -> SMTP & API info>
SMTP_PASSWORD=<Any valid API key, create an API key under Settings -> SMTP & API Info>
```
## Configure default language
```bash
DEFAULT_LOCALE='en'
```
## Configure storage
Chatwoot uses [active storage](https://edgeguides.rubyonrails.org/active_storage_overview.html) for storing attachments. The default storage option is the local storage on your server.
But you can change it to use any of the cloud providers like amazon s3, microsoft azure, google gcs etc. Refer [configuring cloud storage](/docs/self-hosted/deployment/storage/supported-providers) for additional environment variables required.
```bash
ACTIVE_STORAGE_SERVICE=local
```
When `local` storage is used the files are stored under `/storage` directory in the chatwoot root folder.
<Warning>
It is recommended to use a cloud provider for your chatwoot storage to ensure proper backup of the stored attachments and prevent data loss.
</Warning>
## Rails Logging Variables
By default, Chatwoot will capture `info` level logs in production. Ref [rails docs](https://guides.rubyonrails.org/debugging_rails_applications.html#log-levels) for the additional log-level options.
We will also retain 1 GB of your recent logs and your last shifted log file.
You can fine-tune these settings using the following environment variables
```bash
# possible values: 'debug', 'info', 'warn', 'error', 'fatal' and 'unknown'
LOG_LEVEL=
# value in megabytes
LOG_SIZE= 1024
```
## Configure FB Channel
To use FB Channel, you have to create a Facebook app in the developer portal. You can find more details about creating FB channels [here](https://developers.facebook.com/docs/apps/#register)
```bash
FB_VERIFY_TOKEN=
FB_APP_SECRET=
FB_APP_ID=
```
## Using CDN for asset delivery
With the release v1.8.0, we are enabling CDN support for Chatwoot. If you have a high traffic website, we recommend to setup a CDN for your asset delivery. Read setting up [CloudFront as your CDN](/docs/self-hosted/deployment/performance/cloudfront-cdn) guide.
## Enable new account signup
By default, Chatwoot will not allow users to create an account[multi-tenancy] from the login page. However, if you are setting up a public server, you can enable signup using:
```bash
ENABLE_ACCOUNT_SIGNUP=true
```
## Enable direct upload to storage cloud
By default, Chatwoot will upload the files to the application server and then it will push them to the cloud storage. We have introduced the direct upload functionality so that we can upload the file directly to the cloud storage. This has been built according to rails new direct upload functionality documented [here](https://edgeguides.rubyonrails.org/active_storage_overview.html#direct-uploads). Set below environment variable to true to use the direct upload feature.
Make sure to follow [this guide](https://edgeguides.rubyonrails.org/active_storage_overview.html#cross-origin-resource-sharing-cors-configuration) and set the appropriate CORS configuration on your cloud storage after setting `DIRECT_UPLOADS_ENABLED` to true.
```bash
DIRECT_UPLOADS_ENABLED=true
```
## Google OAuth
To enable Google OAuth in Chatwoot, you need to provide the client ID, client secret, and callback URL. You can find the instructions to generate the details [here](https://support.google.com/cloud/answer/6158849).
Set the `GOOGLE_OAUTH_CLIENT_ID` and `GOOGLE_OAUTH_CLIENT_SECRET` environment variables in your Chatwoot installation using the values you copied from the Google API Console. Set the `GOOGLE_OAUTH_CALLBACK_URL` environment variable to the callback URL you used in the Google API Console. Here's an example of the same
```bash
GOOGLE_OAUTH_CLIENT_ID=369777777777-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com
GOOGLE_OAUTH_CLIENT_SECRET=ABCDEF-GHijklmnoPqrstuvwX-yz1234567
GOOGLE_OAUTH_CALLBACK_URL=https://<your-server-domain>/omniauth/google_oauth2/callback
```
<Warning>
The callback URL should comply with the format in the example above. This endpoint cannot be changed at the moment.
</Warning>
After setting these environment variables, restart your Chatwoot server to apply the changes. Now, users will be able to sign in using their Google accounts.
## LogRocket
To enable LogRocket in Chatwoot, you need to provide the project ID from LogRocket. Here are the steps to follow:
1. Open the LogRocket [website](https://logrocket.com/) and create an account or sign in to your existing account.
2. After signing in, create a new project in LogRocket by clicking on "Create new project".
3. Enter a name for your project, and save the project ID.
4. Set the `LOG_ROCKET_PROJECT_ID` environment variable in your `.env` file with the project ID you copied from LogRocket.
```bash
LOG_ROCKET_PROJECT_ID=abcd12/pineapple-on-pizza
```
After setting this environment variable, restart your Chatwoot server to apply the changes. Now, LogRocket will start capturing user sessions on your Chatwoot installation.
@@ -0,0 +1,52 @@
---
title: Help Center
description: Set up a public-facing help center portal with custom domain and SSL certificate
sidebarTitle: Help Center
---
Help center allows you to create a portal and add articles from the chatwoot app dashboard. You can point to these help center portal articles from your main site and display them as your public-facing help center.
## How to get SSL certificate for your custom domain
### Create a Portal in Chatwoot's dashboard
Follow these step to create your Portal. Refer to [this guide.](https://www.chatwoot.com/hc/user-guide/articles/1677861202-how-to-setup-a-help-center)
### Point your custom domain to your Chatwoot domain
1. Go to your DNS provider and add a new CNAME record.
- For the above example, add docs as a CNAME record and point it to the your selfhosted chatwoot domain(FRONTEND_URL).
2. This will ensure that your CNAME record points to the selfhosted Chatwoot installation. For your custom domain, we have your portal information. In this case, `docs.example.com`
### Setting up SSL
1. Use certbot to generate SSL certificates for your custom domain.
```bash
certbot certonly --agree-tos --nginx -d "docs.example.com"
```
2. Create a new nginx config to route requests to this domain to Chatwoot. Make a copy of `/etc/nginx/sites-available/nginx_chatwoot.conf` and make necessary changes for the new domain.
3. Restart nginx server.
```bash
sudo systemctl restart nginx
```
Voila!
`docs.yourdomain.com` is live with a secure connection, and your portal data is visible.
### How does this work?
These are the engineering details to understand `How does docs.yourdomain.com` gets the portal data with SSL certificate.
1. `docs.yourdomain.com` resolves by customers nameserver and redirects to your Chatwoot domain.
2. Chatwoot check for the portal record with custom-domain `docs.yourdomain.com`
3. Redirects to the portal records for the domain `docs.yourdomain.com`
Yaay!!
Now you can have your own help-center, product-documentation related portal saved at Chatwoot dashboard and served at your domain with SSL certificate.
@@ -0,0 +1,49 @@
---
title: Introduction to Chatwoot APIs
description: Learn how to use Chatwoot APIs to build integrations, customize chat experiences, and manage your installation.
sidebarTitle: Introduction
---
Welcome to the Chatwoot API documentation. Whether you're building custom workflows for your support team, integrating Chatwoot into your product, or managing users across installations, our APIs provide the flexibility and power to help you do more with Chatwoot.
Chatwoot provides three categories of APIs, each designed with a specific use case in mind:
- **Application APIs** For account-level automation and agent-facing integrations.
- **Client APIs** For building custom chat interfaces for end-users
- **Platform APIs** For managing and administering installations at scale
---
## Application APIs
Application APIs are designed for interacting with a Chatwoot account from an agent/admin perspective. Use them to build internal tools, automate workflows, or perform bulk operations like data import/export.
- **Authentication**: Requires a user `access_token`, which can be generated from **Profile Settings** after logging into your Chatwoot account.
- **Availability**: Supported on both **Cloud** and **Self-hosted** Chatwoot installations.
- **Example**: [Google Cloud Functions Demo](https://github.com/chatwoot/google-cloud-functions-demo)
---
## Client APIs
Client APIs are intended for building custom messaging experiences over Chatwoot. If you're not using the native website widget or want to embed chat in your mobile app, these APIs are the way to go.
- **Authentication**: Uses `inbox_identifier` (from **Settings → Configuration** in API inboxes) and `contact_identifier` (returned when creating a contact).
- **Availability**: Supported on both **Cloud** and **Self-hosted** Chatwoot installations.
- **Examples**:
- [Client API Demo](https://github.com/chatwoot/client-api-demo)
- [Flutter SDK](https://github.com/chatwoot/chatwoot-flutter-sdk)
---
## Platform APIs
Platform APIs are used to manage Chatwoot installations at the admin level. These APIs allow you to control users, roles, and accounts, or sync data from external authentication systems.
- **Authentication**: Requires an `access_token` generated by a **Platform App**, which can be created in the **Super Admin Console**.
- **Availability**: Available on **Self-hosted** / **Managed Hosting** Chatwoot installations only.
---
Use the right API for your use case, and you'll be able to extend, customize, and integrate Chatwoot into your stack with ease.
@@ -0,0 +1,89 @@
---
title: Contributor Covenant Code of Conduct
description: Code of conduct for Chatwoot community members and contributors
sidebarTitle: Code of Conduct
---
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our community include:
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall community
Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at **hello@chatwoot.com**.
All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series of actions.
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within the community.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 2.0, available at [https://www.contributor-covenant.org/version/2/0/code_of_conduct.html](https://www.contributor-covenant.org/version/2/0/code_of_conduct.html).
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq](https://www.contributor-covenant.org/faq). Translations are available at [https://www.contributor-covenant.org/translations](https://www.contributor-covenant.org/translations).
---
By participating in the Chatwoot community, you agree to abide by this Code of Conduct. Thank you for helping us create a welcoming and inclusive environment for everyone.
@@ -0,0 +1,205 @@
---
title: Chatwoot Community Guidelines
description: Guidelines for participating in the Chatwoot community across all platforms
sidebarTitle: Community Guidelines
---
# Chatwoot Community Guidelines
Welcome to the Chatwoot community! These guidelines help ensure our community remains welcoming, productive, and inclusive for everyone.
## General Principles
### 1. Respect and Inclusivity
Everyone is welcome here. Treat all members with respect, regardless of their background, identity, or level of experience.
### 2. Collaboration Over Conflict
Always approach discussions and feedback with a constructive attitude. We're all here to learn and grow together.
### 3. No Spam or Self-Promotion
Unsolicited advertisements, promotions, or spammy links are not allowed. Share valuable content that benefits the community.
## Platform-Specific Guidelines
### Discord-Specific Guidelines
Our Discord server is where the community gathers for real-time discussions, support, and collaboration.
#### Channel Etiquette
1. **Stay On Topic**: Each channel has its purpose. Ensure your discussions are relevant to the channel topic.
2. **Use Thread Responses**: For lengthy discussions, use thread replies to keep channels organized.
3. **Search Before Asking**: Check pinned messages and recent discussions before asking questions.
#### Content Guidelines
1. **No NSFW Content**: This is a professional community. Do not share or promote any NSFW content.
2. **Quality Over Quantity**: Focus on helpful, meaningful contributions rather than frequent low-value messages.
3. **Appropriate Language**: Keep language professional and appropriate for a business environment.
#### Voice Channels
1. **Microphone Etiquette**: Ensure your microphone is muted when not speaking.
2. **Respect Speaking Time**: Avoid interrupting others and allow everyone to participate.
3. **Background Noise**: Use push-to-talk if you're in a noisy environment.
#### Reporting and Support
1. **Report Violations**: If you see someone violating these guidelines, don't engage. Instead, report it to the moderators.
2. **Use Private Messages**: For sensitive issues, reach out to moderators via private message.
### GitHub-Specific Guidelines
GitHub is our primary platform for code collaboration, issue tracking, and project management.
#### Issue Reporting
1. **Search First**: Before reporting a bug or requesting a feature, search the issues to ensure it hasn't been addressed already.
2. **Use Templates**: Follow the provided issue templates for bug reports and feature requests.
3. **Provide Details**: Include clear steps to reproduce, expected behavior, and actual behavior.
4. **Stay Updated**: Monitor your issues for questions from maintainers and respond promptly.
#### Pull Requests
1. **Clear Descriptions**: Ensure your PRs are concise, have a clear title, and are linked to relevant issues.
2. **Follow Style Guide**: Adhere to the existing coding style and conventions.
3. **Test Thoroughly**: Test your changes in multiple scenarios before submitting.
4. **Respond to Reviews**: Address feedback constructively and make requested changes promptly.
#### Code Review Guidelines
1. **Be Constructive**: Provide specific, actionable feedback rather than general criticism.
2. **Explain Reasoning**: When suggesting changes, explain why the change would improve the code.
3. **Appreciate Good Work**: Acknowledge good code and clever solutions.
4. **Stay Professional**: Keep discussions focused on the code, not the person.
#### Documentation
1. **Update Documentation**: If your PR introduces a new feature, ensure that it's documented.
2. **Fix What You See**: If you spot outdated or missing documentation, consider updating it or raising an issue.
3. **Clear Examples**: Provide clear, working examples in documentation.
## Community Support
### Helping Others
#### In Discord
- **Be Patient**: Remember that people have different experience levels
- **Provide Context**: When helping, explain not just what to do, but why
- **Share Resources**: Link to relevant documentation or previous discussions
- **Follow Up**: Check if your help resolved the issue
#### In GitHub
- **Helpful Comments**: Provide constructive feedback on issues and PRs
- **Share Knowledge**: Contribute to discussions with your expertise
- **Test Solutions**: Help test proposed fixes when possible
### Getting Help
#### Before Asking
1. **Check Documentation**: Review the official docs first
2. **Search History**: Look through previous discussions and issues
3. **Try Solutions**: Attempt basic troubleshooting steps
#### When Asking
1. **Be Specific**: Provide clear details about your issue
2. **Include Context**: Share relevant environment information
3. **Show Effort**: Explain what you've already tried
4. **Be Patient**: Allow time for community members to respond
## Consequences for Violating Guidelines
We enforce these guidelines to maintain a positive community environment.
### Warning System
1. **First Violation**: For most violations, you will receive a warning from the moderators.
2. **Repeated Minor Violations**: Additional warnings may lead to temporary restrictions.
### Immediate Actions
For serious violations, immediate actions may be taken:
- **Spam or Self-Promotion**: Immediate ban or removal
- **Harassment or Abuse**: Immediate removal from the community
- **Sharing Inappropriate Content**: Content removal and potential ban
### Appeal Process
If you believe you've been unfairly moderated:
1. **Contact Moderators**: Reach out via private message
2. **Provide Context**: Explain your perspective respectfully
3. **Accept Decisions**: Respect final moderation decisions
Refer to [enforcement guidelines](/contributing/code-of-conduct#enforcement-guidelines) for more details.
## Moderator and Admin Privileges
### Selection Process
Active contributors to the Chatwoot community, those who consistently offer valuable insights, help, and engagement, may be handpicked as moderators or granted specific privileges.
### Criteria for Moderators
- **Consistent Contribution**: Regular, helpful participation in the community
- **Good Judgment**: Demonstrated ability to handle conflicts constructively
- **Technical Knowledge**: Understanding of Chatwoot and related technologies
- **Time Commitment**: Ability to dedicate time to moderation duties
### Responsibilities
Moderators are expected to:
- **Enforce Guidelines**: Apply community guidelines fairly and consistently
- **Facilitate Discussions**: Help keep conversations productive and on-topic
- **Support Users**: Provide assistance and guidance to community members
- **Report Issues**: Escalate serious violations to administrators
### Discretionary Decisions
- **Appointment Process**: The appointment of moderators and the granting of additional privileges are at the sole discretion of the Chatwoot team.
- **Review Process**: Moderator performance is reviewed regularly to ensure community standards are maintained.
### Admin Privileges
For compliance and security reasons, admin privileges in all Chatwoot communities are reserved exclusively for Chatwoot employees.
## Building a Positive Community
### Encouraging Participation
- **Welcome Newcomers**: Help new members feel included and valued
- **Celebrate Contributions**: Acknowledge helpful contributions and achievements
- **Share Knowledge**: Contribute your expertise to help others learn
- **Provide Feedback**: Offer constructive feedback on ideas and solutions
### Creating Inclusive Environment
- **Use Inclusive Language**: Choose words that welcome all community members
- **Respect Differences**: Value diverse perspectives and experiences
- **Avoid Assumptions**: Don't assume others' backgrounds or knowledge levels
- **Learn Together**: Approach discussions as learning opportunities
## Resources for Community Members
### Getting Started
- **Community Onboarding**: [Discord community](https://discord.com/invite/cJXdrwS)
- **Contributor Guide**: [Contributing documentation](/contributing/introduction)
- **Code of Conduct**: [Detailed guidelines](/contributing/code-of-conduct)
### Stay Connected
- **Discord Server**: Real-time community discussions
- **GitHub Discussions**: Long-form technical discussions
- **Twitter**: [@chatwootapp](https://twitter.com/chatwootapp) for updates
- **Blog**: [Chatwoot Blog](https://www.chatwoot.com/blog) for articles and insights
---
Together, we can build an amazing community that supports Chatwoot users and contributors worldwide. Thank you for being part of our journey! 🚀
@@ -0,0 +1,37 @@
---
title: Contributors
description: Meet the amazing people who contribute to Chatwoot
sidebarTitle: Contributors
---
# Contributors
Chatwoot is made possible by the amazing community of developers, designers, translators, and supporters who contribute their time and expertise to make it better every day.
## Our Contributors
You can find the full list of contributors at [https://contributors.chatwoot.com](https://contributors.chatwoot.com)
<a href="https://github.com/chatwoot/chatwoot/graphs/contributors"><img src="https://contributors.chatwoot.com/api/graph.svg?columns=30&size=32" /></a>
## Join Our Contributors
Ready to make your mark on Chatwoot? Here's how to get started:
### Quick Start
1. **Star the Repository**: [Star Chatwoot on GitHub](https://github.com/chatwoot/chatwoot)
2. **Join Discord**: [Join our Discord community](https://discord.com/invite/cJXdrwS)
3. **Pick an Issue**: Find a [good first issue](https://github.com/chatwoot/chatwoot/labels/good%20first%20issue)
4. **Make Your First Contribution**: Follow our [contribution guide](/contributing/introduction)
### Stay Connected
- **GitHub**: [github.com/chatwoot/chatwoot](https://github.com/chatwoot/chatwoot)
- **Discord**: [discord.com/invite/cJXdrwS](https://discord.com/invite/cJXdrwS)
- **Twitter**: [@chatwootapp](https://twitter.com/chatwootapp)
- **LinkedIn**: [Chatwoot Company Page](https://www.linkedin.com/company/chatwoot)
---
Every contribution, no matter how small, makes Chatwoot better for thousands of users worldwide. Thank you for considering joining our contributor community! 🙏
+127
View File
@@ -0,0 +1,127 @@
---
title: End-to-end testing with Cypress
description: Guide to running Cypress end-to-end tests for Chatwoot
sidebarTitle: Cypress Testing
---
# End-to-end testing with Cypress
Chatwoot uses [Cypress](https://www.cypress.io/) for end-to-end testing. Use the following steps to run the tests on your local machine.
## Prepare the Test Server
Choose any of the given methods to run your Chatwoot test server.
<Tabs>
<Tab title="Local Installation">
### Using Local Chatwoot Installation
<Note>
You have to install the necessary dependencies as described in [setup guide](/contributing/project-setup/setup-guide) for this method to work.
</Note>
Navigate to Chatwoot codebase in your local machine and execute the following steps:
#### Create a fresh test database
```bash
RAILS_ENV=test bin/rake db:drop
RAILS_ENV=test bin/rake db:create
RAILS_ENV=test bin/rake db:schema:load
```
#### Start Chatwoot in the test environment
```bash
RAILS_ENV=test foreman start -f Procfile.test
```
Load the URL in the browser and wait for it to start up:
```
http://localhost:5050/app/login
```
</Tab>
<Tab title="Docker Setup">
### Using Docker
Follow the [docker setup guide](/contributing/project-setup/docker-setup) until you build the images.
#### Change the Rails Environment
Open `docker-compose.yaml` and update all the `RAILS_ENV` values from `development` to `test`:
```yaml
# In docker-compose.yaml
environment:
- RAILS_ENV=test # Change from development to test
```
#### Update the Port
Under rails section in your `docker-compose.yaml` update the port value as given below:
```yaml
# In docker-compose.yaml
ports:
- 5050:3000 # Change from 3000:3000 to 5050:3000
```
#### Reset the Database
```bash
docker-compose run --rm rails bundle exec rails db:reset
```
#### Start Chatwoot Docker in the test environment
```bash
docker-compose up
```
Load the URL in the browser and wait for it to start up:
```
http://localhost:5050/app/login
```
</Tab>
</Tabs>
## Run Cypress
Load `localhost:5050` on your browser and ensure that the Chatwoot server is running.
Navigate to your Chatwoot local directory and execute the following command to run the Cypress tests:
```bash
pnpm cypress open --project ./spec
```
This will open the Cypress Test Runner where you can:
1. **Choose a browser** for running tests
2. **Select test files** to run individual or all tests
3. **Watch tests run** in real-time with step-by-step execution
4. **Debug failed tests** with detailed error information
## Getting Help
If you encounter issues with Cypress testing:
- **Cypress Documentation**: [Official Cypress Docs](https://docs.cypress.io/)
- **Cypress Best Practices**: [Testing Guide](https://docs.cypress.io/guides/references/best-practices)
- **Common Errors**: See [Common Errors](/contributing/project-setup/common-errors)
- **Community Support**: [Discord](https://discord.com/invite/cJXdrwS)
## Useful Resources
- **Cypress API Reference**: [https://docs.cypress.io/api/table-of-contents](https://docs.cypress.io/api/table-of-contents)
- **Testing Library**: [Testing utilities for better element selection](https://testing-library.com/)
- **Cypress Examples**: [Real-world examples](https://github.com/cypress-io/cypress-example-recipes)
---
Your Cypress testing environment is now ready for comprehensive end-to-end testing! 🧪
@@ -0,0 +1,588 @@
---
title: Local Development Setup
description: Set up Chatwoot for local development on your machine
sidebarTitle: Local Development
---
# Local Development Setup
This guide will help you set up Chatwoot for local development on your machine. Follow these steps to get a complete development environment running.
## Prerequisites
Before setting up Chatwoot locally, ensure you have the following installed:
### Required Software
<CardGroup cols={2}>
<Card title="Ruby" icon="gem">
Ruby 3.3.3 (managed with rbenv or RVM)
</Card>
<Card title="Node.js" icon="node-js">
Node.js 20+ with pnpm package manager
</Card>
<Card title="PostgreSQL" icon="database">
PostgreSQL 13+ for the database
</Card>
<Card title="Redis" icon="redis">
Redis 6+ for caching and background jobs
</Card>
</CardGroup>
### System Dependencies
<Tabs>
<Tab title="macOS">
```bash
# Install Homebrew if not already installed
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install dependencies
brew install postgresql@15 redis imagemagick git
# Install rbenv for Ruby version management
brew install rbenv ruby-build
# Install Node.js and pnpm
brew install node
npm install -g pnpm
# Start services
brew services start postgresql@15
brew services start redis
```
</Tab>
<Tab title="Ubuntu/Debian">
```bash
# Update package list
sudo apt update
# Install dependencies
sudo apt install -y curl git build-essential libssl-dev libreadline-dev \
zlib1g-dev libpq-dev imagemagick libmagickwand-dev libffi-dev \
postgresql postgresql-contrib redis-server
# Install rbenv
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/HEAD/bin/rbenv-installer | bash
# Install Node.js (using NodeSource)
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs
# Install pnpm
npm install -g pnpm
# Start services
sudo systemctl start postgresql
sudo systemctl start redis-server
sudo systemctl enable postgresql
sudo systemctl enable redis-server
```
</Tab>
<Tab title="CentOS/RHEL">
```bash
# Install EPEL repository
sudo yum install -y epel-release
# Install dependencies
sudo yum groupinstall -y "Development Tools"
sudo yum install -y curl git openssl-devel readline-devel zlib-devel \
postgresql-devel ImageMagick-devel libffi-devel postgresql-server \
postgresql-contrib redis
# Initialize PostgreSQL
sudo postgresql-setup initdb
# Install rbenv
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/HEAD/bin/rbenv-installer | bash
# Install Node.js
curl -fsSL https://rpm.nodesource.com/setup_20.x | sudo bash -
sudo yum install -y nodejs
# Install pnpm
npm install -g pnpm
# Start services
sudo systemctl start postgresql
sudo systemctl start redis
sudo systemctl enable postgresql
sudo systemctl enable redis
```
</Tab>
</Tabs>
## Ruby Setup
### Install Ruby with rbenv
```bash
# Add rbenv to your shell profile
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
source ~/.bashrc
# Install Ruby 3.3.3
rbenv install 3.3.3
rbenv global 3.3.3
# Verify installation
ruby --version
# Should output: ruby 3.3.3
# Install bundler
gem install bundler
```
### Alternative: Using RVM
```bash
# Install RVM
curl -sSL https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
# Install Ruby 3.3.3
rvm install 3.3.3
rvm use 3.3.3 --default
# Verify installation
ruby --version
gem install bundler
```
## Database Setup
### PostgreSQL Configuration
```bash
# Create PostgreSQL user (macOS with Homebrew)
createuser -s chatwoot
# Create PostgreSQL user (Linux)
sudo -u postgres createuser -s chatwoot
# Set password for the user
sudo -u postgres psql
postgres=# ALTER USER chatwoot PASSWORD 'password';
postgres=# \q
# Create databases
createdb chatwoot_development
createdb chatwoot_test
```
### PostgreSQL Authentication Setup
Edit PostgreSQL configuration to allow local connections:
```bash
# Find pg_hba.conf location
sudo -u postgres psql -c "SHOW hba_file;"
# Edit the file (example path)
sudo nano /etc/postgresql/15/main/pg_hba.conf
# Add or modify these lines:
local all chatwoot md5
host all chatwoot 127.0.0.1/32 md5
host all chatwoot ::1/128 md5
# Restart PostgreSQL
sudo systemctl restart postgresql
```
## Project Setup
### Clone the Repository
```bash
# Fork the repository on GitHub first, then clone your fork
git clone https://github.com/YOUR_USERNAME/chatwoot.git
cd chatwoot
# Add upstream remote
git remote add upstream https://github.com/chatwoot/chatwoot.git
# Verify remotes
git remote -v
```
### Install Dependencies
```bash
# Install Ruby dependencies
bundle install
# Install Node.js dependencies
pnpm install
# Install Playwright for E2E tests (optional)
pnpm exec playwright install
```
### Environment Configuration
```bash
# Copy environment file
cp .env.example .env
# Edit the environment file
nano .env
```
Update the `.env` file with your local configuration:
```bash
# Database configuration
DATABASE_URL=postgresql://chatwoot:password@localhost:5432/chatwoot_development
REDIS_URL=redis://localhost:6379/0
# Application settings
FRONTEND_URL=http://localhost:3000
FORCE_SSL=false
RAILS_ENV=development
NODE_ENV=development
# Email configuration (for development)
MAILER_SENDER_EMAIL=dev@chatwoot.local
SMTP_ADDRESS=localhost
SMTP_PORT=1025
# File storage (local)
ACTIVE_STORAGE_SERVICE=local
# Development features
ENABLE_DEVELOPMENT_FEATURES=true
LOG_LEVEL=debug
```
### Database Initialization
```bash
# Create and migrate the database
bundle exec rails db:create
bundle exec rails db:migrate
# Seed the database with sample data
bundle exec rails db:seed
# Prepare the test database
RAILS_ENV=test bundle exec rails db:create
RAILS_ENV=test bundle exec rails db:migrate
```
## Running the Application
### Start Development Servers
You'll need to run multiple processes for full development:
#### Option 1: Using Foreman (Recommended)
```bash
# Install foreman
gem install foreman
# Start all services
foreman start -f Procfile.dev
```
#### Option 2: Manual Process Management
Open multiple terminal windows/tabs:
```bash
# Terminal 1: Rails server
bundle exec rails server -p 3000
# Terminal 2: Webpack dev server
pnpm run dev
# Terminal 3: Sidekiq worker
bundle exec sidekiq
# Terminal 4: MailHog (for email testing)
mailhog
```
### Access the Application
Once all services are running:
- **Web Application**: http://localhost:3000
- **API Documentation**: http://localhost:3000/swagger
- **Sidekiq Web UI**: http://localhost:3000/sidekiq
- **MailHog (Email)**: http://localhost:8025
### Default Login Credentials
After seeding the database, you can log in with:
- **Email**: john@acme.inc
- **Password**: Password1!
## Development Tools
### Code Quality Tools
```bash
# Install development gems
bundle install --with development test
# Run RuboCop (Ruby linter)
bundle exec rubocop
# Run RuboCop with auto-fix
bundle exec rubocop -a
# Run ESLint (JavaScript linter)
pnpm run lint
# Run ESLint with auto-fix
pnpm run lint:fix
# Run Prettier (code formatter)
pnpm run format
```
### Testing
```bash
# Run Ruby tests
bundle exec rspec
# Run specific test file
bundle exec rspec spec/models/user_spec.rb
# Run JavaScript tests
pnpm run test
# Run E2E tests
pnpm run test:e2e
# Run tests with coverage
COVERAGE=true bundle exec rspec
```
### Database Operations
```bash
# Reset database
bundle exec rails db:drop db:create db:migrate db:seed
# Generate migration
bundle exec rails generate migration AddColumnToTable column:type
# Run migrations
bundle exec rails db:migrate
# Rollback migration
bundle exec rails db:rollback
# Check migration status
bundle exec rails db:migrate:status
```
## IDE and Editor Setup
### VS Code Configuration
Create `.vscode/settings.json`:
```json
{
"ruby.intellisense": "rubyLocate",
"ruby.codeCompletion": "rcodetools",
"ruby.format": "rubocop",
"editor.formatOnSave": true,
"editor.rulers": [120],
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
"eslint.autoFixOnSave": true,
"prettier.requireConfig": true
}
```
### Recommended VS Code Extensions
```json
{
"recommendations": [
"rebornix.ruby",
"wingrunr21.vscode-ruby",
"bradlc.vscode-tailwindcss",
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint",
"ms-vscode.vscode-typescript-next",
"bradlc.vscode-tailwindcss"
]
}
```
### RubyMine Configuration
1. Open the project in RubyMine
2. Configure Ruby SDK: File → Project Structure → SDKs
3. Set up database connection in Database tool window
4. Configure code style: File → Settings → Editor → Code Style
## Debugging
### Rails Debugging
```ruby
# Add to your code for debugging
binding.pry
# Or use the built-in debugger
debugger
```
### JavaScript Debugging
```javascript
// Add to your code
console.log('Debug info:', variable);
debugger;
```
### Database Debugging
```bash
# Rails console
bundle exec rails console
# Database console
bundle exec rails dbconsole
# Check database queries in logs
tail -f log/development.log | grep SQL
```
## Common Issues and Solutions
### Bundle Install Issues
<Accordion title="pg gem installation fails">
```bash
# macOS
brew install postgresql
bundle config build.pg --with-pg-config=/usr/local/bin/pg_config
# Ubuntu/Debian
sudo apt-get install libpq-dev
bundle install
```
</Accordion>
<Accordion title="ImageMagick issues">
```bash
# macOS
brew install imagemagick pkg-config
# Ubuntu/Debian
sudo apt-get install libmagickwand-dev
# Then reinstall the gem
bundle pristine rmagick
```
</Accordion>
### Node.js Issues
<Accordion title="pnpm install fails">
```bash
# Clear cache and reinstall
pnpm store prune
rm -rf node_modules
pnpm install
```
</Accordion>
<Accordion title="Webpack compilation errors">
```bash
# Clear webpack cache
rm -rf tmp/cache/webpacker
pnpm run dev
```
</Accordion>
### Database Issues
<Accordion title="Database connection refused">
```bash
# Check if PostgreSQL is running
sudo systemctl status postgresql
# Start PostgreSQL if not running
sudo systemctl start postgresql
# Check connection
psql -U chatwoot -d chatwoot_development -h localhost
```
</Accordion>
<Accordion title="Permission denied for database">
```bash
# Reset PostgreSQL user password
sudo -u postgres psql
postgres=# ALTER USER chatwoot PASSWORD 'password';
postgres=# \q
```
</Accordion>
## Performance Optimization
### Development Performance Tips
```bash
# Use spring for faster Rails commands
bundle exec spring binstub --all
# Use bootsnap for faster boot times (already included)
# Ensure tmp/cache directory exists
mkdir -p tmp/cache
# Use parallel testing
bundle exec rspec --parallel
# Optimize database queries
# Add to config/environments/development.rb
config.active_record.verbose_query_logs = true
```
### Memory Usage Optimization
```bash
# Monitor memory usage
ps aux | grep ruby
ps aux | grep node
# Use jemalloc for better memory management
export MALLOC_ARENA_MAX=2
bundle exec rails server
```
## Next Steps
Once you have your development environment set up:
1. **Read the Contributing Guidelines**: Check out the [contributing guide](../introduction) for code standards and workflow
2. **Explore the Codebase**: Familiarize yourself with the project structure
3. **Pick an Issue**: Look for "good first issue" labels on GitHub
4. **Join the Community**: Connect with other contributors on Discord or GitHub Discussions
## Getting Help
If you encounter issues during setup:
- **GitHub Issues**: Search existing issues or create a new one
- **Discord Community**: Join the Chatwoot Discord server
- **Documentation**: Check the official documentation
- **Stack Overflow**: Search for Chatwoot-related questions
---
You're now ready to start contributing to Chatwoot! The development environment should be fully functional and ready for coding.
@@ -0,0 +1,196 @@
---
title: Contributing to Chatwoot
description: Complete guide to contributing to Chatwoot - from setting up your development environment to submitting pull requests.
sidebarTitle: Introduction
---
# Contributing Guide
Thank you for taking an interest in contributing to Chatwoot! This guide will help you get started with contributing to our open-source customer support platform. Before submitting your contribution, please make sure to take a moment and read through the following guidelines.
## Getting Started
<Warning>
Before starting your work, ensure an issue exists for it. If not, feel free to create one. You can also take a look into the issues tagged [Good first issues](https://github.com/chatwoot/chatwoot/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22).
</Warning>
### Initial Steps
1. **Check for Existing Issues**: Browse the [GitHub issues](https://github.com/chatwoot/chatwoot/issues) to see if someone is already working on what you want to contribute.
2. **Comment on the Issue**: Add a comment on the issue and wait for the issue to be assigned before you start working on it.
- This helps to avoid multiple people working on similar issues.
3. **Propose Complex Solutions**: If the solution is complex, propose the solution on the issue and wait for one of the core contributors to approve before going into the implementation.
- This helps in shorter turn around times in merging PRs.
4. **Justify New Features**: For new feature requests, provide a convincing reason to add this feature. Real-life business use-cases will be super helpful.
5. **Join the Community**: Feel free to join our [Discord community](https://discord.com/invite/cJXdrwS) if you need further discussions with the core team.
## Pull Request Guidelines
<Info>
We use git-flow branching model. The base branch is `develop`. Please raise your PRs against the `develop` branch.
</Info>
### Before Submitting
- Please make sure that you have read the [issue triage guidelines](https://www.chatwoot.com/hc/handbook/articles/issue-triage-29) before you make a contribution.
- It's okay and encouraged to have multiple small commits as you work on the PR - we will squash the commits before merging.
- For other guidelines, see [PR Guidelines](https://www.chatwoot.com/hc/handbook/articles/pull-request-guidelines-32)
- Ensure that all the text copies that you add into the product are i18n translatable. You are only required to add the `English` version of the strings. We pull in other language translations from our contributors on crowdin. See [Translation guidelines](https://www.chatwoot.com/docs/contributing-guide/translation-guidelines) to learn more.
## Development Workflow
### Developing a New Feature
```bash
# Create a branch in the following format:
feature/<issue-id>-<issue-name>
# Example:
feature/235-contact-panel
```
**Requirements:**
- Add accompanying test cases
- Follow our coding standards
- Include proper documentation
### Bug Fixes or Chores
```bash
# Branch naming for bug fixes:
fix/<issue-id>-<issue-name>
# Branch naming for chores:
chore/<description>
```
**Requirements:**
- If you are resolving a particular issue, add `fix: Fixes xxxx` (#xxxx is the issue) in your PR title
- Provide a detailed description of the bug in the PR
- Add appropriate test coverage if applicable
## Environment Setup
Choose the guide that matches your operating system:
<CardGroup cols={2}>
<Card
title="macOS Setup"
icon="apple"
href="/contributing/project-setup/macos-setup"
>
Complete setup guide for macOS developers
</Card>
<Card
title="Ubuntu Setup"
icon="ubuntu"
href="/contributing/project-setup/ubuntu-setup"
>
Step-by-step Ubuntu installation guide
</Card>
<Card
title="Windows Setup"
icon="windows"
href="/contributing/project-setup/windows-setup"
>
Windows 10/11 development environment setup
</Card>
<Card
title="Docker Setup"
icon="docker"
href="/contributing/project-setup/docker-setup"
>
Quick setup using Docker containers
</Card>
</CardGroup>
### Speed Up Development
Use our [Make commands](/contributing/project-setup/make-setup) to speed up your local development workflow.
## Project Setup
Once you have set up the environment, follow these guides to get Chatwoot running locally:
1. **[Quick Setup Guide](/contributing/project-setup/setup-guide)** - Step-by-step setup instructions
2. **[Environment Variables](/contributing/project-setup/environment-variables)** - Configuration options
3. **[Common Errors](/contributing/project-setup/common-errors)** - Troubleshooting guide
### Special App Integrations
If you're working on specific integrations:
- **[Telegram App Setup](/contributing/project-setup/telegram-app)**
- **[Line App Setup](/contributing/project-setup/line-app)**
- **[Mobile App Development](/contributing/project-setup/mobile-app)**
## Testing Your Contributions
We use comprehensive testing to ensure code quality:
### Test Types
- **Unit Tests**: Test individual components and functions
- **Integration Tests**: Test component interactions
- **End-to-End Tests**: Test complete user workflows with [Cypress](/contributing/testing)
### Running Tests
```bash
# Run all tests
bundle exec rspec
# Run specific test file
bundle exec rspec spec/models/user_spec.rb
# Run Cypress tests
npm run cypress:open
```
## Documentation and Translation
### Documentation Guidelines
- Keep documentation clear and concise
- Include code examples where helpful
- Update documentation when changing functionality
- Follow our [translation guidelines](https://www.chatwoot.com/docs/contributing-guide/other/translation-guidelines)
### Internationalization
- All user-facing text must be translatable
- Only add English strings - other languages are handled via [Crowdin](https://translate.chatwoot.com/)
- Use proper i18n keys and formatting
## Community Guidelines
We strive to maintain a welcoming and inclusive community:
- **[Code of Conduct](https://www.chatwoot.com/docs/contributing-guide/other/code-of-conduct)** - Our community standards
- **[Community Guidelines](https://www.chatwoot.com/docs/contributing-guide/other/community-guidelines)** - How we interact
- **[Security Reports](https://www.chatwoot.com/docs/contributing-guide/other/security-reports)** - Reporting security issues
## API Development
If you're working on API-related features:
- **[Chatwoot APIs](https://www.chatwoot.com/docs/contributing-guide/other/chatwoot-apis)** - API development guide
- **[API Documentation](https://www.chatwoot.com/docs/contributing-guide/other/api-documentation)** - Documenting APIs
- **[Platform APIs](https://www.chatwoot.com/docs/contributing-guide/other/chatwoot-platform-apis)** - Platform-level APIs
## Recognition
We value all contributions to Chatwoot. Check out our [Contributors page](https://www.chatwoot.com/docs/contributing-guide/other/contributors) to see the amazing people who have helped make Chatwoot better.
## Getting Help
Need assistance? Here are your options:
- **GitHub Issues**: For bug reports and feature requests
- **Discord Community**: For real-time discussions with the core team
- **Documentation**: Comprehensive guides and API references
- **Community Forums**: Connect with other contributors
---
Ready to start contributing? Pick an issue that interests you and follow our guidelines above. Every contribution, no matter how small, helps make Chatwoot better for everyone! 🚀
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,283 @@
---
title: Docker Development Setup
description: Complete guide to setting up Chatwoot development environment using Docker and Docker Compose.
sidebarTitle: Docker Setup
---
# Docker Development Setup
This guide will help you set up a complete Chatwoot development environment using Docker and Docker Compose.
## Pre-requisites
Before proceeding, make sure you have the latest version of `docker` and `docker-compose` installed.
As of now, we recommend a version equal to or higher than the following:
```bash
$ docker --version
Docker version 25.0.4, build 1a576c5
$ docker compose --version
docker-compose version 2.24.7
```
### Install Docker
#### Windows
1. **Download Docker Desktop** from [https://www.docker.com/products/docker-desktop/](https://www.docker.com/products/docker-desktop/)
2. **Run the installer** and follow setup instructions
3. **Enable WSL2 backend** (recommended)
4. **Restart your computer** when prompted
#### macOS
```bash
# Option 1: Download from website
# Go to https://www.docker.com/products/docker-desktop/
# Option 2: Using Homebrew
brew install --cask docker
```
#### Linux (Ubuntu/Debian)
```bash
# Update package index
sudo apt update
# Install dependencies
sudo apt install -y apt-transport-https ca-certificates curl gnupg lsb-release
# Add Docker's official GPG key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
# Add Docker repository
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
# Install Docker
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
# Add user to docker group
sudo usermod -aG docker $USER
# Start Docker service
sudo systemctl start docker
sudo systemctl enable docker
```
<Warning>
After adding yourself to the docker group on Linux, log out and log back in for the changes to take effect.
</Warning>
## Development Environment
1. **Clone the repository.**
```bash
git clone https://github.com/chatwoot/chatwoot.git
```
2. **Make a copy of the example environment file and modify it as required.**
```bash
# Navigate to Chatwoot
cd chatwoot
cp .env.example .env
# Update redis and postgres passwords
nano .env
# Update docker-compose.yaml with the same postgres password
nano docker-compose.yaml
```
3. **Build the images.**
```bash
# Build base image first
docker compose build base
# Build the server and worker
docker compose build
```
4. **After building the image or destroying the stack, you would have to reset the database using the following command.**
```bash
docker compose run --rm rails bundle exec rails db:chatwoot_prepare
```
5. **To run the app:**
```bash
docker compose up
```
* Access the rails app frontend by visiting `http://0.0.0.0:3000/`
* Access Mailhog inbox by visiting `http://0.0.0.0:8025/` (You will receive all emails going out of the application here)
#### Login with credentials
```
url: http://localhost:3000
user_name: john@acme.inc
password: Password1!
```
6. **To stop the app:**
```bash
docker compose down
```
## Running RSpec Tests
For running the complete RSpec tests:
```bash
docker compose run --rm rails bundle exec rspec
```
For running specific test:
```bash
docker compose run --rm rails bundle exec rspec spec/<path-to-file>:<line-number>
```
## Production Environment
To debug the production build locally, set `SECRET_KEY_BASE` environment variable in your `.env` file and then run the below commands:
```bash
docker compose -f docker-compose.production.yaml build
docker compose -f docker-compose.production.yaml up
```
## Debugging Mode
To use debuggers like `byebug` or `binding.pry`, use the following command to bring up the app instead of `docker compose up`:
```bash
docker compose run --rm --service-port rails
```
## Development Workflow
### Daily Development Commands
```bash
# Start development environment
docker compose up
# View logs
docker compose logs -f rails
# Access Rails console
docker compose exec rails bundle exec rails console
# Run migrations
docker compose exec rails bundle exec rails db:migrate
# Install new gems
docker compose exec rails bundle install
# Restart a service
docker compose restart rails
# Stop all services
docker compose down
# Stop and remove volumes (reset database)
docker compose down -v
```
## Troubleshooting
If there is an update to any of the following:
- `dockerfile`
- `gemfile`
- `package.json`
- schema change
Make sure to rebuild the containers and run `db:reset`.
```bash
docker compose down
docker compose build
docker compose run --rm rails bundle exec rails db:reset
docker compose up
```
### Common Issues
<Accordion title="Container fails to start">
**Solution**: Check service dependencies and logs:
```bash
# Check service status
docker compose ps
# Check logs for specific service
docker compose logs rails
# Restart problematic service
docker compose restart rails
```
</Accordion>
<Accordion title="Database connection refused">
**Solution**: Ensure PostgreSQL container is healthy:
```bash
# Check postgres health
docker compose exec postgres pg_isready
# Restart postgres if needed
docker compose restart postgres
```
</Accordion>
<Accordion title="Port already in use">
**Solution**: Stop other services using the same ports:
```bash
# Check what's using port 3000
lsof -i :3000
# Or change ports in docker-compose.yaml
```
</Accordion>
<Accordion title="Out of disk space">
**Solution**: Clean up Docker resources:
```bash
# Remove unused containers, networks, images
docker system prune -f
# Remove volumes (WARNING: This deletes data)
docker volume prune -f
# Remove everything (nuclear option)
docker system prune -a --volumes
```
</Accordion>
<Accordion title="Build fails">
**Solution**: Clear Docker cache and rebuild:
```bash
# Clear build cache
docker builder prune
# Rebuild without cache
docker compose build --no-cache
```
</Accordion>
## Getting Help
If you encounter Docker-specific issues:
- **Docker Documentation**: [https://docs.docker.com/](https://docs.docker.com/)
- **Docker Compose Reference**: [https://docs.docker.com/compose/](https://docs.docker.com/compose/)
- **Chatwoot Issues**: [GitHub Issues](https://github.com/chatwoot/chatwoot/issues)
- **Community Support**: [Discord](https://discord.com/invite/cJXdrwS)
---
Your Docker development environment is now ready for Chatwoot development! 🐳
@@ -0,0 +1,17 @@
---
title: Environment Variables for Development
description: Complete guide to environment variables for Chatwoot development and testing
sidebarTitle: Environment Variables
---
# Environment Variables for Development
This guide covers environment variables specifically for development and testing environments. For production environment variables, see the [Self-hosted Environment Variables](../../self-hosted/configuration/environment-variables) guide.
### Use letter opener instead of mailhog/SMTP
Set the following variable to open emails in letter opener instead of SMTP
```bash
LETTER_OPENER=true
```
Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

@@ -0,0 +1,198 @@
---
title: Line App Integration Setup
description: Setup Line app integration on your local machine for development
sidebarTitle: Line Setup
---
# Setup Line app integration on your local machine
Please follow the steps if you are trying to work with the Line integration on your local machine.
## Prerequisites
- Line Developer Account
- Access to [Line Developer Console](https://developers.line.biz/console)
- Ngrok or similar tunneling service
- Running Chatwoot development environment
## Setup Steps
### 1. Start Ngrok Server
Start a Ngrok server listening at port `3000` or the port you will be running the Chatwoot installation:
```bash
# Install ngrok if you haven't already
# Download from https://ngrok.com/download
# Start ngrok tunnel
ngrok http 3000
```
### 2. Update Environment Variables
Update the `.env` variable `FRONTEND_URL` in Chatwoot with the `https` version of the Ngrok URL:
```bash
# In your .env file
FRONTEND_URL=https://your-ngrok-subdomain.ngrok.io
```
### 3. Configure Line Developer Console
1. **Access Line Developer Console**: Go to [Line Developer Console](https://developers.line.biz/console)
2. **Create a Provider** (if you don't have one)
3. **Create a New Channel** and select "Messaging API"
4. **Configure Basic Settings**:
- Channel name
- Channel description
- Category
- Subcategory
### 4. Get Required Credentials
From the Line Developer Console under the "Messaging API" channel, collect the following values:
1. **Channel Name**
2. **LINE Channel ID**
3. **LINE Channel Secret**
4. **LINE Channel Token**
### 5. Start Chatwoot Server
Start the Chatwoot server and create a new Line channel with the values obtained from Line Developer Console:
```bash
# Start the development server
make run
# or
foreman start -f Procfile.dev
```
### 6. Create Line Channel in Chatwoot
1. **Access Chatwoot**: Go to your Chatwoot instance (http://localhost:3000)
2. **Navigate to Settings** → **Inboxes** → **Add Inbox**
3. **Select Line** as the channel type
4. **Enter Line Credentials**:
- Channel Name
- LINE Channel ID
- LINE Channel Secret
- LINE Channel Token
5. **Save Configuration**
## Configure Webhook in Line Developer Console
After creating the channel, Chatwoot will provide a webhook URL for the channel. You need to configure this webhook URL in the Line Developer Console:
### Steps to Configure Webhook
1. **Go to Line Developer Console** → Your Channel → **Messaging API**
2. **Find Webhook Settings**
3. **Set Webhook URL**: Use the URL provided by Chatwoot
```
https://your-ngrok-subdomain.ngrok.io/webhooks/line/your-channel-id
```
4. **Enable Webhook**: Toggle the webhook to "Enabled"
5. **Verify Webhook**: Use the "Verify" button to test the connection
### Additional Line Settings
Configure these settings in the Line Developer Console:
- **Auto-reply messages**: Disable (so Chatwoot can handle responses)
- **Greeting messages**: Optional
- **Webhook redelivery**: Enable for reliability
## Testing the Integration
If the webhook is registered correctly with Line, your Ngrok server should receive events for new Line messages, and new conversations will be created in Chatwoot.
### Test Steps
1. **Add your Line bot as a friend** using the QR code or bot ID
2. **Send a message** to your Line bot
3. **Check Ngrok logs** to see if the webhook request is received
4. **Check Chatwoot** to see if a new conversation is created
5. **Reply from Chatwoot** to test bidirectional communication
## Troubleshooting
<Accordion title="Webhook verification fails">
**Problem**: Line webhook verification fails in Developer Console
**Solution**:
- Ensure your Ngrok URL is accessible publicly
- Check that `FRONTEND_URL` is set correctly in your `.env` file
- Verify the webhook URL format is correct
- Restart Chatwoot after updating environment variables
</Accordion>
<Accordion title="Messages not appearing in Chatwoot">
**Problem**: Line messages don't create conversations in Chatwoot
**Solution**:
- Check Ngrok logs for incoming webhook requests
- Verify webhook is enabled in Line Developer Console
- Check Chatwoot logs for any error messages
- Ensure all Line credentials are entered correctly
- Verify the channel is enabled in Chatwoot
</Accordion>
<Accordion title="SSL/TLS errors">
**Problem**: SSL certificate issues with webhook
**Solution**:
- Use the `https` version of your Ngrok URL
- Ensure Ngrok is running properly
- Line requires HTTPS for webhook URLs
- Try restarting Ngrok and updating the webhook
</Accordion>
<Accordion title="Authentication errors">
**Problem**: Line API authentication failures
**Solution**:
- Verify Channel ID, Channel Secret, and Channel Token are correct
- Check that the channel is published and not in development mode
- Ensure the Messaging API is enabled for your channel
- Regenerate Channel Token if necessary
</Accordion>
## Line API Features
Line offers various features you can integrate:
- **Rich Messages**: Cards, carousels, quick replies
- **Flex Messages**: Custom layouts
- **LIFF (Line Frontend Framework)**: Web apps within Line
- **Line Login**: User authentication
## Next Steps
After successful setup:
1. **Test message flow** between Line and Chatwoot
2. **Configure agent assignments** for Line conversations
3. **Set up automated responses** if needed
4. **Explore rich message features** for enhanced user experience
5. **Review webhook logs** for debugging
## Getting Help
If you encounter issues:
- **Check Logs**: Review both Chatwoot and Ngrok logs
- **Line Developers Documentation**: [Official Line API Docs](https://developers.line.biz/en/docs/)
- **Common Errors**: See [Common Errors](/contributing/project-setup/common-errors)
- **Community Support**: [Discord](https://discord.com/invite/cJXdrwS)
## Useful Resources
- **Line Messaging API Documentation**: [https://developers.line.biz/en/docs/messaging-api/](https://developers.line.biz/en/docs/messaging-api/)
- **Line Developer Console**: [https://developers.line.biz/console](https://developers.line.biz/console)
- **Webhook Test Tool**: Available in Line Developer Console
---
Your Line integration is now ready for development and testing! 💬
@@ -0,0 +1,314 @@
---
title: macOS Development Setup
description: Complete guide to setting up your macOS development environment for Chatwoot contribution.
sidebarTitle: macOS Setup
---
# macOS Development Setup
This guide will help you set up your macOS development environment for contributing to Chatwoot. Open Terminal app and run the following commands.
## Installing the Standalone Command Line Tools
Open Terminal app and run:
```bash
xcode-select --install
```
This installs essential development tools including Git, GCC, and other command line utilities.
## Install Homebrew
Homebrew is the missing package manager for macOS:
```bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
```
After installation, add Homebrew to your PATH (if not automatically added):
```bash
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
```
## Install Git
```bash
brew update
brew install git
```
Configure Git with your information:
```bash
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"
```
## Install Ruby Version Manager
Choose between RVM or rbenv for managing Ruby versions.
### Option 1: Install RVM (Recommended)
```bash
curl -L https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
```
### Option 2: Install rbenv (Alternative)
```bash
brew install rbenv ruby-build
echo 'eval "$(rbenv init -)"' >> ~/.zshrc
source ~/.zshrc
```
## Install Ruby
Chatwoot APIs are built on Ruby on Rails. You need to install Ruby 3.2.2.
### If using RVM:
```bash
rvm install ruby-3.2.2
rvm use 3.2.2 --default
source ~/.rvm/scripts/rvm
```
### If using rbenv:
```bash
rbenv install 3.2.2
rbenv global 3.2.2
```
<Info>
rbenv identifies the ruby version from `.ruby-version` file on the root of the project and loads it automatically.
</Info>
Verify Ruby installation:
```bash
ruby --version
# Should output: ruby 3.2.2
```
## Install Node.js
Chatwoot requires Node.js version 20:
```bash
brew install node@20
```
If you need to link Node.js 20:
```bash
brew link node@20
echo 'export PATH="/opt/homebrew/opt/node@20/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
```
Verify Node.js installation:
```bash
node --version
# Should output: v20.x.x
```
## Install pnpm
We use `pnpm` as our package manager for better performance:
```bash
brew install pnpm
```
Verify pnpm installation:
```bash
pnpm --version
```
## Install PostgreSQL
The database used in Chatwoot is PostgreSQL.
### Option 1: PostgresApp (Recommended)
1. Download and install PostgresApp from [https://postgresapp.com](https://postgresapp.com)
2. This is the easiest way to get started with PostgreSQL on macOS
3. Follow the setup instructions on their website
### Option 2: Homebrew Installation
```bash
brew install postgresql@14
```
Start PostgreSQL service:
```bash
brew services start postgresql@14
```
Create a PostgreSQL user:
```bash
createuser -s postgres
```
Connect to PostgreSQL to verify installation:
```bash
psql postgres
# Type \q to exit
```
## Install Redis Server
Chatwoot uses Redis server for agent assignments and reporting:
```bash
brew install redis
```
Start the Redis service:
```bash
brew services start redis
```
Verify Redis installation:
```bash
redis-cli ping
# Should output: PONG
```
## Install ImageMagick
Chatwoot uses ImageMagick library to resize images for previews and thumbnails:
```bash
brew install imagemagick
```
Verify ImageMagick installation:
```bash
convert --version
```
## Install Additional Dependencies
Install other useful development tools:
```bash
# Install Yarn (alternative to pnpm if needed)
brew install yarn
# Install SQLite (for testing)
brew install sqlite
# Install libvips (for image processing)
brew install libvips
```
## Install Docker (Optional)
For development and testing with containers:
```bash
# Install Docker Desktop
brew install --cask docker
```
Or download Docker Desktop from [https://www.docker.com/products/docker-desktop/](https://www.docker.com/products/docker-desktop/).
## Environment Verification
Verify all installations are working:
```bash
# Check versions
ruby --version # Should be 3.2.2
node --version # Should be v20.x.x
pnpm --version # Should show pnpm version
psql --version # Should show PostgreSQL version
redis-cli --version # Should show Redis version
convert --version # Should show ImageMagick version
git --version # Should show Git version
```
## Configure Shell Environment
Add useful aliases to your shell configuration file (`~/.zshrc` for Zsh):
```bash
# Add to ~/.zshrc
echo '# Chatwoot Development Aliases' >> ~/.zshrc
echo 'alias cw-server="bundle exec rails server"' >> ~/.zshrc
echo 'alias cw-console="bundle exec rails console"' >> ~/.zshrc
echo 'alias cw-test="bundle exec rspec"' >> ~/.zshrc
echo 'alias cw-migrate="bundle exec rails db:migrate"' >> ~/.zshrc
# Reload shell configuration
source ~/.zshrc
```
## Troubleshooting Common Issues
<Accordion title="Command line tools installation fails">
**Solution**: Update macOS to the latest version and try again. You can also download Xcode from the App Store.
</Accordion>
<Accordion title="Homebrew installation permission errors">
**Solution**:
```bash
sudo chown -R $(whoami) /opt/homebrew
```
</Accordion>
<Accordion title="Ruby installation fails with RVM">
**Solution**:
```bash
# Install missing dependencies
brew install openssl readline libyaml
rvm reinstall 3.2.2 --with-openssl-dir=$(brew --prefix openssl)
```
</Accordion>
<Accordion title="PostgreSQL connection refused">
**Solution**:
```bash
# Restart PostgreSQL
brew services restart postgresql@14
# Check if it's running
brew services list | grep postgresql
```
</Accordion>
<Accordion title="ImageMagick installation issues">
**Solution**:
```bash
# If you encounter issues, try:
brew uninstall imagemagick
brew install imagemagick
```
</Accordion>
## Getting Help
If you encounter issues:
- **Common Errors**: Check [Common Errors](/contributing/project-setup/common-errors)
- **Discord Community**: Join our [Discord](https://discord.com/invite/cJXdrwS)
- **GitHub Issues**: [Create an issue](https://github.com/chatwoot/chatwoot/issues)
---
Your macOS development environment is now ready for Chatwoot development! 🚀
@@ -0,0 +1,115 @@
---
title: Make Commands Setup
description: Speed up your local development workflow with Make commands for Chatwoot.
sidebarTitle: Make Setup
---
# Speed up your local development with Make
Speed up your local development workflow with make commands for Chatwoot.
## Clone the repo and cd to the Chatwoot directory
Clone the repository and navigate to the Chatwoot directory:
```bash
git clone https://github.com/chatwoot/chatwoot.git
cd chatwoot
```
## Install Ruby & JavaScript dependencies
Install Ruby and JavaScript dependencies using the following command. This command runs Bundler and pnpm:
```bash
make burn
```
## Run database migrations
Apply necessary database schema changes to your development environment by running the following command:
```bash
make db
```
## Run database seed
Load some seed data to your development environment for testing by running the following command:
```bash
make db_seed
```
## Run dev server using Overmind
Start the development server using Overmind, a process manager that can run multiple processes concurrently:
```bash
make run
```
## Force run if ./.overmind.sock file exists
If the `make run` command fails due to the existence of a `./.overmind.sock` file, you can try using the following command:
```bash
make force_run
```
## Debug - Attach to backend via Overmind tmux session
For debugging purposes, you can attach to the backend via the Overmind tmux session using the following command:
```bash
make debug
```
## Debug worker
To debug the worker, use the following command:
```bash
make debug_worker
```
## Get Rails console
Access the Rails console, which provides an interactive environment for interacting with the Chatwoot application:
```bash
make console
```
## Build Docker image
Build the Docker image for the Chatwoot project:
```bash
make docker
```
## Workflow after pulling in the latest changes from `develop`
To update your development environment after pulling the latest changes from the `develop` branch, follow these steps:
```bash
make burn # Install dependencies
make db # Run migrations
make run # Start the server
```
## Getting Help
If you encounter issues with Make commands:
- **Makefile Documentation**: Check the project's `Makefile` for available commands
- **Overmind Documentation**: [https://github.com/DarthSim/overmind](https://github.com/DarthSim/overmind)
- **Chatwoot Issues**: [GitHub Issues](https://github.com/chatwoot/chatwoot/issues)
- **Community Support**: [Discord](https://discord.com/invite/cJXdrwS)
---
Your Make-based development workflow is now ready for efficient Chatwoot development! 🚀
@@ -0,0 +1,242 @@
---
title: Mobile App Development Setup
description: Setup guide for Chatwoot mobile app development
sidebarTitle: Mobile App Setup
---
# Setup guide for mobile app
Complete guide to setting up the Chatwoot mobile app for development and contribution.
## Installation and setup
### Prerequisites
Before starting, ensure you have the following installed:
- [Node.js](https://nodejs.org/en/download/) (Latest LTS version)
- [React Native CLI](https://reactnative.dev/docs/environment-setup)
- [Expo CLI](https://docs.expo.dev/get-started/installation/)
- [Expo Account](https://expo.dev/signup)
<Note>
To learn more about the most up-to-date instructions, please refer to the guide available [here](https://docs.expo.dev/get-started/set-up-your-environment/).
</Note>
### Clone the repository
```bash
git clone git@github.com:chatwoot/chatwoot-mobile-app.git
cd chatwoot-mobile-app
```
### Install dependencies
```bash
pnpm install
```
### Install Expo CLI
```bash
pnpm install -g expo-cli
```
## Environment Variables
Create your environment configuration file:
```bash
cp .env.example .env
```
Configure the following environment variables:
| Name | Description | Default Value | Required |
| ---------------------------------------- | ------------------------------------------- | ------------------------ | -------- |
| EXPO_PUBLIC_CHATWOOT_WEBSITE_TOKEN | Web widget token for in-app support | - | No |
| EXPO_PUBLIC_CHATWOOT_BASE_URL | Self-hosted installation URL | https://app.chatwoot.com | Yes |
| EXPO_PUBLIC_JUNE_SDK_KEY | June analytics SDK key | - | No |
| EXPO_PUBLIC_MINIMUM_CHATWOOT_VERSION | Minimum supported Chatwoot version | - | Yes |
| EXPO_PUBLIC_SENTRY_DSN | Sentry DSN URL for error reporting | - | No |
| EXPO_PUBLIC_PROJECT_ID | Expo project identifier | - | Yes |
| EXPO_PUBLIC_APP_SLUG | Application slug for Expo | - | Yes |
| EXPO_PUBLIC_SENTRY_PROJECT_NAME | Project name in Sentry | - | No |
| EXPO_PUBLIC_SENTRY_ORG_NAME | Organization name in Sentry | - | No |
| EXPO_PUBLIC_IOS_GOOGLE_SERVICES_FILE | Path to iOS Google Services config file | - | No |
| EXPO_PUBLIC_ANDROID_GOOGLE_SERVICES_FILE | Path to Android Google Services config file | - | No |
| EXPO_APPLE_ID | Apple Developer account ID | - | No |
| EXPO_APPLE_TEAM_ID | Apple Developer team ID | - | No |
| EXPO_STORYBOOK_ENABLED | Enable/disable Storybook | false | No |
## Generate the native code
```bash
pnpm generate
```
This command generates native Android and iOS directories using [Prebuild](https://docs.expo.dev/workflow/continuous-native-generation/).
<Warning>
You need to run pre-build if you add a new native dependency to your project or change the project configuration in Expo app config (app.config.ts).
</Warning>
## How to run the app
Connect your iPhone/Android device and run the following command to install the app on your device.
### iOS Development
```bash
pnpm run:ios
```
### Android Development
```bash
pnpm run:android
```
## Package Installation
<Warning>
Please always install packages using the command `npx expo install package-name` instead of `pnpm install package-name`.
</Warning>
This is crucial for native dependencies because Expo will automatically install the correct compatible version, while pnpm/yarn/npm may install the latest version, which may not be compatible.
```bash
# Correct way to install packages
npx expo install package-name
# Incorrect way (may cause compatibility issues)
pnpm install package-name
```
## Push notification
If you are using the community edition of Chatwoot, you can now use the [official mobile app](https://www.chatwoot.com/mobile-apps) with push notifications without any additional configuration.
For more details, please refer to the [push notification documentation](https://www.chatwoot.com/hc/handbook/articles/1687935909-push-notification).
## Build & Submit using EAS
We use Expo Application Services (EAS) for building, deploying, and submitting the app to app stores. EAS Build and Submit is available to anyone with an Expo account, regardless of whether you pay for EAS or use our Free plan.
You can sign up at [Expo EAS](https://expo.dev/eas).
### Build the app
#### iOS Build
```bash
pnpm run build:ios:local
```
#### Android Build
```bash
pnpm run build:android:local
```
### Submit the app
#### iOS Submission
```bash
pnpm submit:ios
```
#### Android Submission
```bash
pnpm submit:android
```
When you run the above command, you will be prompted to provide a path to a local app binary file. Please select the file that you built in the previous step:
- **iOS**: `.ipa` file
- **Android**: `.aab` file
<Note>
It may take a while to complete the submission process. You will see the status of the submission on your terminal.
</Note>
## Troubleshooting
<Accordion title="Metro bundler issues">
**Problem**: Metro bundler fails to start or bundle
**Solution**:
```bash
# Clear cache and restart
pnpm clear
pnpm start --reset-cache
```
</Accordion>
<Accordion title="iOS build fails">
**Problem**: iOS build or simulator issues
**Solution**:
- Ensure Xcode is properly installed
- Check iOS simulator version compatibility
- Clear derived data in Xcode
- Restart Metro bundler
</Accordion>
<Accordion title="Android build fails">
**Problem**: Android build or emulator issues
**Solution**:
- Verify Android Studio setup
- Check SDK versions and build tools
- Ensure emulator is running
- Clear Gradle cache
</Accordion>
<Accordion title="Expo CLI issues">
**Problem**: Expo commands fail
**Solution**:
```bash
# Update Expo CLI
npm install -g @expo/cli@latest
# Login to Expo
expo login
# Clear Expo cache
expo r -c
```
</Accordion>
## Contributing Guidelines
When contributing to the mobile app:
1. **Follow coding standards**: Use ESLint and Prettier configurations
2. **Write tests**: Include unit tests for new features
3. **Test on both platforms**: Ensure iOS and Android compatibility
4. **Update documentation**: Document new features and changes
5. **Check performance**: Monitor app performance impact
## Getting Help
If you encounter issues:
- **Expo Documentation**: [Official Expo Docs](https://docs.expo.dev/)
- **React Native Documentation**: [React Native Docs](https://reactnative.dev/docs/getting-started)
- **GitHub Issues**: [Mobile App Issues](https://github.com/chatwoot/chatwoot-mobile-app/issues)
- **Community Support**: [Discord](https://discord.com/invite/cJXdrwS)
## Useful Resources
- **Expo Development**: [https://docs.expo.dev/](https://docs.expo.dev/)
- **React Native**: [https://reactnative.dev/](https://reactnative.dev/)
- **EAS Build**: [https://docs.expo.dev/build/introduction/](https://docs.expo.dev/build/introduction/)
- **EAS Submit**: [https://docs.expo.dev/submit/introduction/](https://docs.expo.dev/submit/introduction/)
---
Your Chatwoot mobile app development environment is now ready! 📱
@@ -0,0 +1,181 @@
---
title: Project Setup Guide
description: Complete guide to setting up and running Chatwoot in development mode
sidebarTitle: Setup Guide
---
# Project Setup
This guide will help you to setup and run Chatwoot in development mode. Please make sure you have completed the environment setup.
## Clone the repo
```bash
# change location to the path you want chatwoot to be installed
cd ~
# clone the repo and cd to chatwoot dir
git clone https://github.com/chatwoot/chatwoot.git
cd chatwoot
```
## Install Ruby & Javascript dependencies
Use the following command to run `bundle && pnpm install` to install ruby and Javascript dependencies.
```bash
make burn
```
This would install all required dependencies for Chatwoot application.
<Warning>
If you face issue with pg gem, please refer to [Common Errors](/contributing/project-setup/common-errors#pg-gem-installation-error)
</Warning>
## Setup environment variables
```bash
cp .env.example .env
```
Please refer to [environment-variables](/contributing/project-setup/environment-variables) to read on setting environment variables.
## Setup rails server
```bash
# run db migrations
make db
# fireup the server
foreman start -f Procfile.dev
```
<Note>
If you have overmind installed, use `make run` to run the server.
</Note>
## Login with credentials
```bash
http://localhost:3000
user name: john@acme.inc
password: Password1!
```
## Testing chat widget in your local environment
When running Chatwoot in development environment, the chat widget can be accessed under the following URL.
```
http://localhost:3000/widget_tests
```
You can also test the `setUser` method by using
```
http://localhost:3000/widget_tests?setUser=true
```
## Docker for development
<Note>
Follow this section only if you are trying to setup Chatwoot via docker. Else skip this.
</Note>
The first time you start your development environment run the following two commands:
```bash
# build base image first
docker compose build base
# build the server and worker
docker compose build
# prepare the database
docker compose exec rails bundle exec rails db:chatwoot_prepare
# docker compose up
```
Then browse http://localhost:3000
```bash
# To stop your environment use Control+C (on Mac) CTRL+C (on Win) or
docker compose down
# start the services
docker compose up
```
When you change the service's Dockerfile or the contents of the build directory, run stop then build. (For example after modifying package.json or Gemfile)
```bash
docker compose stop
docker compose build
```
The docker-compose environment consists of:
- chatwoot server
- postgres
- redis
- webpacker-dev-server
If in case you encounter a seeding issue or you want reset the database you can do it using the following command:
```bash
docker compose run --rm rails bundle exec rake db:reset
```
This command essentially runs postgres and redis containers and then run the rake command inside the chatwoot server container.
## Running Cypress Tests
Refer the docs to learn how to write cypress specs:
- https://github.com/shakacode/cypress-on-rails
- https://docs.cypress.io/guides/overview/why-cypress.html
```bash
# in terminal tab1
overmind start -f Procfile.test
# in terminal tab2
pnpm cypress open --project ./test
```
## Debugging Docker for production
You can use our official Docker image from [https://hub.docker.com/r/chatwoot/chatwoot](https://hub.docker.com/r/chatwoot/chatwoot)
```bash
docker pull chatwoot/chatwoot
```
You can create an image yourselves by running the following command on the root directory.
```bash
docker compose -f docker-compose.production.yaml build
```
This will build the image which you can deploy in Kubernetes (GCP, Openshift, AWS, Azure or anywhere), Amazon ECS or Docker Swarm. You can tag this image and push this image to docker registry of your choice.
Remember to make the required environment variables available during the deployment.
## Next Steps
After completing this setup:
1. **Verify Installation**: Access http://localhost:3000 and log in with the provided credentials
2. **Explore the Code**: Start making changes and see them reflected in your development environment
3. **Run Tests**: Execute the test suite to ensure everything works correctly
4. **Check Troubleshooting**: If you encounter issues, refer to [Common Errors](/contributing/project-setup/common-errors)
## Getting Help
If you encounter issues during setup:
- **Common Errors**: Check [Common Errors](/contributing/project-setup/common-errors)
- **Environment Variables**: See [Environment Variables](/contributing/project-setup/environment-variables)
- **Discord Community**: Join our [Discord](https://discord.com/invite/cJXdrwS)
- **GitHub Issues**: [Create an issue](https://github.com/chatwoot/chatwoot/issues)
---
Your Chatwoot development environment is now ready for contribution! 🚀
@@ -0,0 +1,129 @@
---
title: Telegram App Integration Setup
description: Setup Telegram app integration on your local machine for development
sidebarTitle: Telegram Setup
---
# Setup Telegram app integration on your local machine
Please follow the steps if you are trying to work with the Telegram integration on your local machine.
## Prerequisites
- Telegram Bot Token from [BotFather](https://t.me/botfather)
- Ngrok or similar tunneling service
- Running Chatwoot development environment
## Setup Steps
### 1. Start Ngrok Server
Start a Ngrok server listening at port `3000` or the port you will be running the Chatwoot installation:
```bash
# Install ngrok if you haven't already
# Download from https://ngrok.com/download
# Start ngrok tunnel
ngrok http 3000
```
### 2. Update Environment Variables
Update the `.env` variable `FRONTEND_URL` in Chatwoot with the `https` version of the Ngrok URL:
```bash
# In your .env file
FRONTEND_URL=https://your-ngrok-subdomain.ngrok.io
```
### 3. Start Chatwoot Server
Start the Chatwoot server and create a new Telegram channel with the token obtained from Telegram BotFather.
```bash
# Start the development server
make run
# or
foreman start -f Procfile.dev
```
### 4. Create Telegram Channel
1. **Access Chatwoot**: Go to your Chatwoot instance (http://localhost:3000)
2. **Navigate to Settings** → **Inboxes** → **Add Inbox**
3. **Select Telegram** as the channel type
4. **Enter Bot Token**: Paste the token you received from BotFather
5. **Configure Channel**: Set up the channel name and other settings
## Verify Webhook Registration
While creating the channel, Chatwoot should have registered a webhook callback URL in Telegram for your Bot. You can verify whether this URL registration was done successfully by calling the Telegram API:
```bash
GET https://api.telegram.org/bot{your_bot_token}/getWebhookInfo
```
## Testing the Integration
If the webhook is registered correctly with Telegram, your Ngrok server should receive events for new Telegram messages, and new conversations will be created in Chatwoot.
### Test Steps
1. **Send a message** to your Telegram bot
2. **Check Ngrok logs** to see if the webhook request is received
3. **Check Chatwoot** to see if a new conversation is created
4. **Reply from Chatwoot** to test bidirectional communication
## Troubleshooting
<Accordion title="Webhook not registered">
**Problem**: Telegram webhook registration fails
**Solution**:
- Ensure your Ngrok URL is accessible publicly
- Check that `FRONTEND_URL` is set correctly in your `.env` file
- Verify the bot token is correct
- Restart Chatwoot after updating environment variables
</Accordion>
<Accordion title="Messages not appearing in Chatwoot">
**Problem**: Telegram messages don't create conversations in Chatwoot
**Solution**:
- Check Ngrok logs for incoming webhook requests
- Verify the webhook URL in Telegram using the API call above
- Check Chatwoot logs for any error messages
- Ensure the channel is properly configured and enabled
</Accordion>
<Accordion title="SSL/TLS errors">
**Problem**: SSL certificate issues with webhook
**Solution**:
- Use the `https` version of your Ngrok URL
- Ensure Ngrok is running properly
- Try restarting Ngrok and updating the webhook
</Accordion>
## Next Steps
After successful setup:
1. **Test message flow** between Telegram and Chatwoot
2. **Configure agent assignments** for Telegram conversations
3. **Set up automated responses** if needed
4. **Review webhook logs** for debugging
## Getting Help
If you encounter issues:
- **Check Logs**: Review both Chatwoot and Ngrok logs
- **Telegram Bot API**: [Official Documentation](https://core.telegram.org/bots/api)
- **Common Errors**: See [Common Errors](/contributing/project-setup/common-errors)
- **Community Support**: [Discord](https://discord.com/invite/cJXdrwS)
---
Your Telegram integration is now ready for development and testing! 📱
@@ -0,0 +1,246 @@
---
title: Ubuntu Development Setup
description: Complete guide to setting up your Ubuntu development environment for Chatwoot contribution.
sidebarTitle: Ubuntu Setup
---
# Ubuntu Development Setup
This guide will help you set up your Ubuntu development environment for contributing to Chatwoot. These instructions work for Ubuntu 20.04, 22.04, and newer versions.
## Update System Packages
First, update your system packages to ensure you have the latest security updates:
```bash
sudo apt update
sudo apt upgrade -y
```
## Install Essential Build Tools
Install fundamental development tools and dependencies:
```bash
sudo apt install -y curl wget gnupg2 software-properties-common apt-transport-https ca-certificates build-essential libssl-dev libreadline-dev zlib1g-dev libyaml-dev libxml2-dev libxslt-dev
```
## Install Git
Install Git for version control:
```bash
sudo apt install -y git
```
Configure Git with your information:
```bash
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"
```
Verify Git installation:
```bash
git --version
```
## Install Ruby Version Manager (RVM)
Install RVM to manage Ruby versions:
```bash
# Install GPG keys
curl -sSL https://rvm.io/mpapis.asc | gpg --import -
curl -sSL https://rvm.io/pkuczynski.asc | gpg --import -
# Install RVM
curl -L https://get.rvm.io | bash -s stable
# Load RVM into current shell
source ~/.rvm/scripts/rvm
```
Add RVM to your shell profile:
```bash
echo 'source ~/.rvm/scripts/rvm' >> ~/.bashrc
source ~/.bashrc
```
## Install Ruby
Install Ruby 3.2.2 using RVM:
```bash
# Install Ruby 3.2.2
rvm install ruby-3.2.2
# Set as default Ruby version
rvm use 3.2.2 --default
# Verify installation
ruby --version
# Should output: ruby 3.2.2
```
## Install Node.js
Install Node.js 20 using NodeSource repository:
```bash
# Add NodeSource repository
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
# Install Node.js
sudo apt install -y nodejs
# Verify installation
node --version
# Should output: v20.x.x
npm --version
```
## Install pnpm
Install pnpm package manager:
```bash
# Install pnpm globally
npm install -g pnpm
# Verify installation
pnpm --version
```
## Install PostgreSQL
Install PostgreSQL database server:
```bash
# Install PostgreSQL
sudo apt install -y postgresql postgresql-contrib libpq-dev
# Start and enable PostgreSQL service
sudo systemctl start postgresql
sudo systemctl enable postgresql
```
Configure PostgreSQL:
```bash
# Switch to postgres user and create a superuser
sudo -u postgres createuser --superuser $USER
# Set password for your user
sudo -u postgres psql -c "ALTER USER $USER PASSWORD 'password';"
# Create a database for your user
sudo -u postgres createdb $USER
```
Verify PostgreSQL installation:
```bash
psql --version
psql -c "SELECT version();"
```
## Install Redis
Install Redis server for background job processing:
```bash
# Install Redis
sudo apt install -y redis-server
# Start and enable Redis service
sudo systemctl start redis-server
sudo systemctl enable redis-server
```
Verify Redis installation:
```bash
redis-cli ping
# Should output: PONG
```
## Install ImageMagick
Install ImageMagick for image processing:
```bash
sudo apt install -y imagemagick libmagickwand-dev
```
Verify ImageMagick installation:
```bash
convert --version
```
## Troubleshooting Common Issues
<Accordion title="Ruby installation fails">
**Solution**: Install missing dependencies:
```bash
sudo apt install -y autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm6 libgdbm-dev libdb-dev
rvm reinstall 3.2.2
```
</Accordion>
<Accordion title="PostgreSQL authentication fails">
**Solution**: Configure peer authentication:
```bash
sudo -u postgres psql
ALTER USER postgres PASSWORD 'your_password';
\q
# Edit pg_hba.conf
sudo nano /etc/postgresql/*/main/pg_hba.conf
# Change 'peer' to 'md5' for local connections
sudo systemctl restart postgresql
```
</Accordion>
<Accordion title="Permission denied for /usr/local">
**Solution**: Fix ownership:
```bash
sudo chown -R $USER:$USER /usr/local
```
</Accordion>
<Accordion title="Node.js installation issues">
**Solution**: Use Node Version Manager (nvm):
```bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
source ~/.bashrc
nvm install 20
nvm use 20
nvm alias default 20
```
</Accordion>
<Accordion title="ImageMagick policy errors">
**Solution**: Update ImageMagick policy:
```bash
sudo nano /etc/ImageMagick-6/policy.xml
# Comment out or modify restrictive policies
```
</Accordion>
## Getting Help
If you encounter issues:
- **Common Errors**: Check [Common Errors](/contributing/project-setup/common-errors)
- **Discord Community**: Join our [Discord](https://discord.com/invite/cJXdrwS)
- **GitHub Issues**: [Create an issue](https://github.com/chatwoot/chatwoot/issues)
- **Ubuntu Community**: [Ubuntu Forums](https://ubuntuforums.org/)
---
Your Ubuntu development environment is now ready for Chatwoot development! 🐧
@@ -0,0 +1,320 @@
---
title: Windows Development Setup
description: Complete guide to setting up your Windows development environment for Chatwoot contribution using WSL2.
sidebarTitle: Windows Setup
---
# 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.
<img src="/contributing/project-setup/img/developer-mode.jpg" width="500" alt="Enable Developer Mode" />
## 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.
<img src="/contributing/project-setup/img/enable-wsl.jpg" width="500" alt="Enable WSL" />
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
### Option 1: Using Microsoft Store (Recommended)
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:
```powershell
# Install WSL2 with Ubuntu
wsl --install -d Ubuntu-22.04
# Set WSL2 as default version
wsl --set-default-version 2
```
## Step 4: Initial Ubuntu Setup
When you first launch Ubuntu, you'll be prompted to create a user account:
```bash
# Create a username and password when prompted
# This will be your Linux user account
```
Update the system packages:
```bash
sudo apt update && sudo apt upgrade -y
```
## Step 5: Install Core Dependencies
You need core Linux dependencies installed in order to install Ruby and other tools.
```bash
sudo apt-get update
sudo apt-get install -y git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev software-properties-common libffi-dev
```
## Installing RVM & Ruby
Install additional dependencies required for RVM:
```bash
sudo apt-get install -y libgdbm-dev libncurses5-dev automake libtool bison libffi-dev
```
Install RVM & Ruby version 3.2.2:
```bash
# Add RVM GPG keys
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
# Install RVM
curl -sSL https://get.rvm.io | bash -s stable
# Load RVM into current session
source ~/.rvm/scripts/rvm
# Install Ruby 3.2.2
rvm install 3.2.2
rvm use 3.2.2 --default
# Verify installation
ruby -v
```
## Install Node.js
Chatwoot requires Node.js version 20. Install Node.js from NodeSource using the following commands:
```bash
curl -sL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejs
```
Verify Node.js installation:
```bash
node --version
# Should output: v20.x.x
```
## Install pnpm
We use `pnpm` as the package manager for better performance:
```bash
# Install pnpm globally
npm install -g pnpm
# Verify installation
pnpm --version
```
## Install PostgreSQL
The database used in Chatwoot is PostgreSQL. Use the following commands to install PostgreSQL:
```bash
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:
```bash
sudo -u postgres psql
```
Install `libpq-dev` dependencies for Ubuntu:
```bash
sudo apt-get install -y libpq-dev
```
Start PostgreSQL service:
```bash
sudo service postgresql start
```
Configure PostgreSQL to start automatically:
```bash
echo 'sudo service postgresql start' >> ~/.bashrc
```
Create a database user:
```bash
# Switch to postgres user and create a superuser
sudo -u postgres createuser --superuser $USER
# Set password for your user
sudo -u postgres psql -c "ALTER USER $USER PASSWORD 'password';"
```
## Install Redis Server
Chatwoot uses Redis server for agent assignments and reporting. To install `redis-server`:
```bash
sudo apt-get install -y redis-server
```
Start Redis service:
```bash
sudo service redis-server start
```
Configure Redis to start automatically:
```bash
echo 'sudo service redis-server start' >> ~/.bashrc
```
Enable Redis to start on system boot:
```bash
sudo systemctl enable redis-server.service
```
## Install ImageMagick
Chatwoot uses ImageMagick for image processing:
```bash
sudo apt-get install -y imagemagick libmagickwand-dev
```
## Configure Git
Set up Git with your information:
```bash
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"
```
## Windows-Specific Configuration
### Install VS Code with WSL Extension
1. **Install Visual Studio Code** on Windows from [https://code.visualstudio.com/](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:
```bash
# Add to ~/.bashrc for better file permissions
echo 'umask 022' >> ~/.bashrc
# Configure Git to ignore file mode changes
git config --global core.filemode false
```
## Environment Verification
Verify all installations are working correctly:
```bash
# Check all versions
ruby --version # Should be 3.2.2
node --version # Should be v20.x.x
pnpm --version # Should show pnpm version
psql --version # Should show PostgreSQL version
redis-cli ping # Should output: PONG
convert --version # Should show ImageMagick version
git --version # Should show Git version
```
## Troubleshooting Common Issues
<Accordion title="WSL installation fails">
**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
</Accordion>
<Accordion title="Ubuntu terminal won't open">
**Solution**: Reset WSL or reinstall Ubuntu:
```powershell
# Reset Ubuntu (will delete all data)
wsl --unregister Ubuntu-22.04
wsl --install -d Ubuntu-22.04
```
</Accordion>
<Accordion title="PostgreSQL fails to start">
**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
```
</Accordion>
<Accordion title="Permission denied errors">
**Solution**: Fix file permissions:
```bash
# For the entire project
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
# For executable files
chmod +x bin/*
```
</Accordion>
<Accordion title="Slow performance">
**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
```
</Accordion>
If you encounter issues during setup:
- **Common Errors**: Check [Common Errors](/contributing/project-setup/common-errors)
- **WSL2 Documentation**: [Microsoft WSL Documentation](https://docs.microsoft.com/en-us/windows/wsl/)
- **Discord Community**: Join our [Discord](https://discord.com/invite/cJXdrwS)
- **GitHub Issues**: [Create an issue](https://github.com/chatwoot/chatwoot/issues)
---
Your Windows development environment with WSL2 is now ready for Chatwoot development! 🪟🐧
@@ -0,0 +1,127 @@
---
title: Reporting Security Issues
description: How to report security vulnerabilities in Chatwoot
sidebarTitle: Security Reports
---
# Reporting Security Issues
Chatwoot is looking forward to working with security researchers worldwide to keep Chatwoot and our users safe. If you have found an issue in our systems/applications, please reach out to us.
## Reporting a Vulnerability
We use GitHub for security issues that affect our project. If you believe you have found a vulnerability, please disclose it via this [form](https://github.com/chatwoot/chatwoot/security/advisories/new).
This will enable us to review the vulnerability, fix it promptly, and reward you for your efforts.
If you have any questions about the process, contact **security@chatwoot.com**.
Please try your best to describe a clear and realistic impact for your report, and please don't open any public issues on GitHub or social media; we're doing our best to respond through GitHub as quickly as possible.
<Note>
Please use the email for questions related to the process. Disclosures should be done via [GitHub](https://github.com/chatwoot/chatwoot/security/advisories/new).
</Note>
## Supported Versions
| Version | Supported |
| -------- | --------- |
| latest | ️✅ |
| < latest | ❌ |
## Vulnerabilities We Care About 🫣
<Warning>
Please do not perform testing against Chatwoot production services. Use a `self-hosted instance` to perform tests.
</Warning>
We consider the following vulnerabilities as high priority:
- Remote command execution
- SQL Injection
- Authentication bypass
- Privilege Escalation
- Cross-site scripting (XSS)
- Performing limited admin actions without authorization
- CSRF
## Non-Qualifying Vulnerabilities
We consider the following out of scope, though there may be exceptions:
- Missing HTTP security headers
- Incomplete/Missing SPF/DKIM
- Reports from automated tools or scanners
- Theoretical attacks without proof of exploitability
- Social engineering
- Reflected file download
- Physical attacks
- Weak SSL/TLS/SSH algorithms or protocols
- Attacks involving physical access to a user's device or a device or network that's already seriously compromised (e.g., man-in-the-middle)
- The user attacks themselves
- Incomplete/Missing SPF/DKIM
- Denial of Service attacks
- Brute force attacks
- DNSSEC
If you are unsure about the scope, please create a [report](https://github.com/chatwoot/chatwoot/security/advisories/new).
## Triaging Process
Chatwoot team triages the issues in GitHub weekly. We're doing our best to respond through GitHub as quickly as we can, so please don't open any public issues on GitHub or social media and avoid duplicate reports over emails.
- Based on reviewing the report, the team will assign a priority to the issue and move it into the internal backlog to prioritize a fix.
- In cases where the team needs more information or disagreements of severity, the team will communicate the same over GitHub before completing the triaging.
After triage, the team will start working on the issue based on the following severity and timelines:
## Response Timeline
| Severity | Timeline |
| ------------- | --------- |
| Critical (P0) | 7 Days |
| High | 30 Days |
| Medium | 60 Days |
| Low | 90 Days |
## Security Best Practices
### For Researchers
- **Test Responsibly**: Only test on your own self-hosted instances
- **Provide Clear Details**: Include steps to reproduce, impact assessment, and suggested fixes
- **Be Patient**: Allow time for our team to investigate and respond
- **Follow Responsible Disclosure**: Don't publish vulnerabilities publicly until they're fixed
### For Users
- **Keep Updated**: Always use the latest version of Chatwoot
- **Secure Configuration**: Follow security best practices for your deployment
- **Monitor Logs**: Regularly check logs for suspicious activity
- **Report Issues**: If you notice anything unusual, report it through proper channels
## Bounty Program
While we don't currently have a formal bug bounty program, we do recognize and appreciate security researchers who help us improve Chatwoot's security:
- **Hall of Fame**: Recognition on our security acknowledgments page
- **Direct Communication**: Work directly with our security team
- **Early Access**: Get early access to security updates and patches
## Getting Help
If you need assistance with security reporting:
- **Process Questions**: Contact security@chatwoot.com
- **Technical Issues**: Use our [Discord community](https://discord.com/invite/cJXdrwS)
- **General Support**: Check our [documentation](/contributing/project-setup/common-errors)
## Thanks
Thank you for keeping Chatwoot and our users safe. 🙇
Your efforts help us maintain a secure platform for thousands of businesses worldwide. We appreciate the time and expertise you contribute to making Chatwoot better for everyone.
---
Remember: Security is a shared responsibility. Together, we can make Chatwoot safer for everyone.
@@ -0,0 +1,151 @@
---
title: Translate Chatwoot to Your Language
description: Guide to translating Chatwoot using Crowdin translation platform
sidebarTitle: Translation Guidelines
---
# Translate Chatwoot to Your Language
Chatwoot uses American English by default. Each and every string available in Chatwoot can be translated to the language of your choice. Chatwoot uses Crowdin to manage the translation process. The updates from Crowdin are also included along with every release.
## How do I see the strings that need to be translated?
In the codebase, the strings are placed in the following locations:
- `app/javascript/dashboard/i18n` - The strings related to the agent dashboard
- `app/javascript/widget/i18n` - The strings related to the web widget
- `app/javascript/survey/i18n` - The strings related to CSAT surveys
- `config/locales` - The strings used in backend messages or API responses
You can login to **Crowdin** ([https://translate.chatwoot.com](https://translate.chatwoot.com)) and create an account to view the strings that need to be translated.
## How to contribute?
If you don't find your language on Crowdin, please create an issue on [GitHub](https://github.com/chatwoot/chatwoot/issues) to add the language.
### Translate Strings
The translation process for Chatwoot web and mobile app is managed at [https://translate.chatwoot.com](https://translate.chatwoot.com) using Crowdin. You will have to create an account at Crowdin before you can select a language and contribute.
<Note>
New to Crowdin? Check out their [getting started guide](https://support.crowdin.com/crowdin-intro/) to learn the basics of translation management.
</Note>
### Translation Guidelines
#### Formal vs Informal Context
At Chatwoot, we prefer to use formal form of language wherever possible. For instance in German there are two forms of "you" where one is rather used in formal contexts ("Sie") and the other one is used among friends ("Du"). "Sie" is preferred over "Du" in translating Chatwoot.
#### Consistency Guidelines
- **Maintain consistency** across similar contexts and features
- **Use standard terminology** for technical terms when available in your language
- **Keep placeholders intact** - Don't translate variables like `{name}` or `%{count}`
- **Preserve formatting** - Maintain HTML tags, markdown, and line breaks
- **Consider context** - UI strings may need to be shorter than descriptive text
#### Brand and Product Names
- **Chatwoot** - Always keep as "Chatwoot" (don't translate)
- **Feature names** - Translate feature names but maintain consistency
- **Third-party services** - Keep original names (GitHub, Slack, etc.)
### Proofreading
Proofreading helps ensure the accuracy and consistency of translations. Right now, the translations are being accepted without a proofreading step. This would be changed in the future as and when there are more contributors for each language.
<Warning>
If you are the only person contributing to a language, make sure that you inform any of the Chatwoot members to gain access to manage the language.
</Warning>
### Releasing a New Language
All the translated strings would be included in the next release. If a language has **60% or more translated strings** in Crowdin, we would enable the language in Chatwoot app during the next release.
#### Steps to Raise a Pull Request for New Language
Please use this [pull request](https://github.com/chatwoot/chatwoot/pull/7905) as a reference for enabling a new language into Chatwoot.
- Ensure language is added and enabled in `config/initializers/languages.rb`
- Include the language in `i18n/index.js` for all the packs → `dashboard, widget, survey`
- Select the language from Chatwoot settings UI and confirm the PR to be working
## Translation Progress and Metrics
### Current Status
You can check the translation progress for different languages on our [Crowdin project page](https://translate.chatwoot.com). This shows:
- **Overall completion percentage** for each language
- **Component-wise progress** (Dashboard, Widget, Survey, API)
- **Recent activity** and contributor statistics
### Quality Metrics
We track several quality indicators:
- **Translation coverage** - Percentage of strings translated
- **Review coverage** - Percentage of translations reviewed
- **Consistency score** - How consistent terminology is across the platform
- **Community engagement** - Number of active translators
## Best Practices for Translators
### Before You Start
1. **Review existing translations** in your language for consistency
2. **Understand the context** - Test the feature in Chatwoot if possible
3. **Check for existing glossaries** or style guides for your language
4. **Join the community** discussions for your language
### During Translation
1. **Focus on user experience** - How will end users understand this?
2. **Maintain professional tone** appropriate for business communication
3. **Ask questions** if context is unclear
4. **Suggest improvements** for source text if needed
### After Translation
1. **Test your translations** in a live Chatwoot instance
2. **Report issues** if translations don't fit in the UI
3. **Help review** other contributors' work
4. **Stay updated** with new strings added
## Getting Help and Support
### Community Resources
- **GitHub Discussions**: [Translation category](https://github.com/chatwoot/chatwoot/discussions/categories/translations)
- **Discord**: Join our [Discord community](https://discord.gg/uPtCrFfb9B) (#translations channel)
- **Crowdin Comments**: Use comments feature in Crowdin for context-specific questions
### Technical Support
For technical issues with translations:
- **Missing context**: Create an issue on GitHub
- **UI layout problems**: Report in Discord with screenshots
- **Crowdin access issues**: Contact the maintainers
### Recognition
We recognize and appreciate our translation contributors:
- **Contributors page**: Featured on our contributors page
- **Release notes**: Mentioned in release announcements
- **Community highlights**: Featured in community updates
## Multilingual Support Features
Chatwoot's internationalization supports:
- **Right-to-left (RTL) languages** - Arabic, Hebrew, etc.
- **Pluralization rules** - Correct plural forms for different languages
- **Date and time formatting** - Localized date/time display
- **Number formatting** - Currency and number format localization
---
Ready to help make Chatwoot accessible to users worldwide? [Start translating today](https://translate.chatwoot.com)! 🌍
+253 -51
View File
@@ -28,67 +28,269 @@
},
"theme": "maple",
"navigation": {
"groups": [
"anchors": [
{
"group": "API Reference",
"anchor": "Introduction",
"icon": "house",
"pages": [
"introduction"
]
},
{
"group": "Application API",
"description": "APIs for managing application aspects of Chatwoot",
"includeTags": [
"Agents",
"Automation Rule",
"Account AgentBots",
"Canned Responses",
"Contact Labels",
"Contacts",
"Conversation Assignments",
"Conversation Labels",
"Conversations",
"Custom Attributes",
"Custom Filters",
"Help Center",
"Inboxes",
"Integrations",
"Messages",
"Profile",
"Reports",
"Teams",
"Webhooks"
],
"openapi": "https://raw.githubusercontent.com/chatwoot/chatwoot/develop/swagger/tag_groups/application_swagger.json"
"anchor": "Installation & Setup",
"icon": "server",
"pages": [
{
"group": "Getting Started",
"pages": [
"self-hosted/introduction",
"self-hosted/architecture",
"self-hosted/requirements"
]
},
{
"group": "Deployment Methods",
"pages": [
{
"group": "Linux",
"pages": [
"self-hosted/deployment/linux-vm",
"self-hosted/deployment/docker"
]
},
"self-hosted/deployment/kubernetes",
"self-hosted/deployment/chatwoot-ctl"
]
},
{
"group": "Cloud Providers",
"pages": [
{
"group": "AWS",
"pages": [
"self-hosted/cloud/aws",
"self-hosted/cloud/aws-marketplace"
]
},
"self-hosted/cloud/azure",
"self-hosted/cloud/digitalocean",
"self-hosted/cloud/gcp",
"self-hosted/cloud/heroku",
{
"group": "Community Contributed",
"pages": [
"self-hosted/cloud/caprover",
"self-hosted/cloud/clevercloud",
"self-hosted/cloud/cloudron",
"self-hosted/cloud/restack",
"self-hosted/cloud/easypanel",
"self-hosted/cloud/elestio"
]
}
]
},
{
"group": "Configuration",
"pages": [
"self-hosted/configuration/environment-variables",
{
"group": "Performance",
"pages": [
"self-hosted/configuration/performance/optimizing-configurations",
"self-hosted/configuration/performance/cloudfront-cdn"
]
},
{
"group": "Monitoring",
"pages": [
"self-hosted/configuration/monitoring/super-admin-console",
"self-hosted/configuration/monitoring/apm-and-tracing",
"self-hosted/configuration/monitoring/rate-limiting"
]
},
{
"group": "Storage",
"pages": [
"self-hosted/configuration/storage/supported-providers",
"self-hosted/configuration/storage/s3-bucket",
"self-hosted/configuration/storage/gcs-bucket"
]
},
{
"group": "Email Channel",
"pages": [
"self-hosted/configuration/features/email-channel/conversation-continuity",
"self-hosted/configuration/features/email-channel/conversation-continuity-using-sendgrid",
"self-hosted/configuration/features/email-channel/email-channel-setup",
"self-hosted/configuration/features/email-channel/azure-app-setup",
"self-hosted/configuration/features/email-channel/google-workspace-setup"
]
},
{
"group": "Help Center",
"pages": [
"self-hosted/configuration/help-center"
]
}
]
},
{
"group": "Integrations",
"pages": [
"self-hosted/configuration/integrations/facebook-channel-setup",
"self-hosted/configuration/integrations/instagram-channel-setup",
"self-hosted/configuration/integrations/instagram-via-instagram-business-login",
"self-hosted/configuration/integrations/slack-integration-setup",
"self-hosted/configuration/integrations/linear-integration-setup",
"self-hosted/configuration/integrations/shopify-integration-setup"
]
},
{
"group": "Maintenance",
"pages": [
"self-hosted/maintenance/upgrade",
"self-hosted/maintenance/backup"
]
},
{
"group": "Runbooks",
"pages": [
"self-hosted/runbook/migrate-chatwoot-database",
"self-hosted/runbook/upgrade-to-chatwoot-v4",
"self-hosted/runbook/enable-ip-logging",
"self-hosted/runbook/email-notifications"
]
},
{
"group": "Others",
"pages": [
"self-hosted/others/telemetry",
"self-hosted/others/enterprise-edition",
"self-hosted/others/supported-features",
"self-hosted/others/restricted-instances",
"self-hosted/others/instagram-app-review",
"self-hosted/others/faq"
]
}
]
},
{
"group": "Platform API",
"description": "APIs for managing platform aspects of Chatwoot",
"includeTags": [
"Accounts",
"Account Users",
"AgentBots",
"Users"
],
"openapi": "https://raw.githubusercontent.com/chatwoot/chatwoot/develop/swagger/tag_groups/platform_swagger.json"
"anchor": "Contributing Guide",
"icon": "code",
"pages": [
{
"group": "Getting Started",
"pages": [
"contributing/introduction"
]
},
{
"group": "Environment Setup",
"pages": [
"contributing/project-setup/macos-setup",
"contributing/project-setup/ubuntu-setup",
"contributing/project-setup/windows-setup",
"contributing/project-setup/docker-setup",
"contributing/project-setup/make-setup"
]
},
{
"group": "Project Setup",
"pages": [
"contributing/project-setup/setup-guide",
"contributing/project-setup/environment-variables",
"contributing/project-setup/common-errors",
"contributing/project-setup/telegram-channel-setup",
"contributing/project-setup/line-channel-setup",
"contributing/project-setup/mobile-app-setup"
]
},
{
"group": "Testing",
"pages": [
"contributing/cypress"
]
},
{
"group": "Others",
"pages": [
"contributing/code-of-conduct",
"contributing/security-reports",
"contributing/translation-guidelines",
"contributing/community-guidelines",
"contributing/contributors"
]
}
]
},
{
"group": "Client API",
"description": "APIs for client applications",
"includeTags": [
"Contacts API",
"Conversations API",
"Messages API"
],
"openapi": "https://raw.githubusercontent.com/chatwoot/chatwoot/develop/swagger/tag_groups/client_swagger.json"
},
{
"group": "Other APIs",
"description": "Other Chatwoot APIs",
"includeTags": [
"CSAT Survey Page"
],
"openapi": "https://raw.githubusercontent.com/chatwoot/chatwoot/develop/swagger/tag_groups/other_swagger.json"
"anchor": "API Reference",
"icon": "square-terminal",
"pages": [],
"groups": [
{
"group": "Getting Started",
"description": "Learn about Chatwoot APIs and how to use them",
"pages": [
"api-reference/introduction"
]
},
{
"group": "Application APIs",
"description": "APIs for managing application aspects of Chatwoot",
"includeTags": [
"Agents",
"Automation Rule",
"Account AgentBots",
"Canned Responses",
"Contact Labels",
"Contacts",
"Conversation Assignments",
"Conversation Labels",
"Conversations",
"Custom Attributes",
"Custom Filters",
"Help Center",
"Inboxes",
"Integrations",
"Messages",
"Profile",
"Reports",
"Teams",
"Webhooks"
],
"openapi": "https://raw.githubusercontent.com/chatwoot/chatwoot/develop/swagger/tag_groups/application_swagger.json"
},
{
"group": "Platform APIs",
"description": "APIs for managing platform aspects of Chatwoot",
"includeTags": [
"Accounts",
"Account Users",
"AgentBots",
"Users"
],
"openapi": "https://raw.githubusercontent.com/chatwoot/chatwoot/develop/swagger/tag_groups/platform_swagger.json"
},
{
"group": "Client APIs",
"description": "APIs for client applications",
"includeTags": [
"Contacts API",
"Conversations API",
"Messages API"
],
"openapi": "https://raw.githubusercontent.com/chatwoot/chatwoot/develop/swagger/tag_groups/client_swagger.json"
},
{
"group": "Other APIs",
"description": "Additional Chatwoot APIs",
"includeTags": [
"CSAT Survey Page"
],
"openapi": "https://raw.githubusercontent.com/chatwoot/chatwoot/develop/swagger/tag_groups/other_swagger.json"
}
]
}
]
},
+87 -40
View File
@@ -1,49 +1,96 @@
---
title: Introduction to Chatwoot APIs
description: Learn how to use Chatwoot APIs to build integrations, customize chat experiences, and manage your installation.
title: Welcome to Chatwoot Developer Docs
description: Your comprehensive guide to installing, configuring, developing with, and integrating Chatwoot - the open-source customer support platform.
sidebarTitle: Introduction
---
Welcome to the Chatwoot API documentation. Whether you're building custom workflows for your support team, integrating Chatwoot into your product, or managing users across installations, our APIs provide the flexibility and power to help you do more with Chatwoot.
# Welcome to Chatwoot Developer Documentation
Chatwoot provides three categories of APIs, each designed with a specific use case in mind:
Welcome to the complete developer documentation for Chatwoot, the open-source customer support platform trusted by thousands of businesses worldwide. Whether you're setting up your own instance, contributing to the project, or building integrations, this documentation will guide you through every step.
- **Application APIs** For account-level automation and agent-facing integrations.
- **Client APIs** For building custom chat interfaces for end-users
- **Platform APIs** For managing and administering installations at scale
## What You'll Find Here
<CardGroup cols={2}>
<Card
title="Installation & Setup"
icon="server"
href="/self-hosted/introduction"
>
Deploy Chatwoot on your infrastructure with Docker, Kubernetes, or cloud providers
</Card>
<Card
title="Development Guide"
icon="code"
href="/contributing/introduction"
>
Contribute to Chatwoot with our development setup, testing guidelines, and best practices
</Card>
<Card
title="API Reference"
icon="square-terminal"
href="/api-reference/introduction"
>
Build powerful integrations with our comprehensive REST APIs
</Card>
<Card
title="Architecture"
icon="sitemap"
href="/self-hosted/architecture"
>
Understand Chatwoot's system architecture and components
</Card>
</CardGroup>
## Getting Started Paths
Choose your path based on what you want to accomplish:
### 🚀 **I want to install Chatwoot**
Perfect! Head to our [Installation Guide](/self-hosted/introduction) to deploy Chatwoot on your preferred platform. We support:
- Docker containers for quick setup
- Kubernetes for scalable deployments
- Major cloud providers (AWS, GCP, Azure)
- Traditional Linux VMs
### 🛠️ **I want to contribute to Chatwoot**
Amazing! Check out our [Contributing Guide](/contributing/introduction) to:
- Set up your development environment
- Understand our coding standards
- Learn our testing practices
- Submit your first pull request
### 🔌 **I want to build integrations**
Great! Explore our [API Reference](/api-reference/introduction) with three categories of APIs:
- **Application APIs** - Manage accounts, agents, and conversations
- **Platform APIs** - Administrative control for installations
- **Client APIs** - Build custom chat interfaces
### 📚 **I want to understand the architecture**
Excellent! Our [Architecture Guide](/self-hosted/architecture) covers:
- System components and their interactions
- Database schemas and relationships
- Scalability considerations
- Security best practices
## Why Chatwoot?
Chatwoot is built with modern technologies and follows industry best practices:
- **Open Source**: Full transparency and community-driven development
- **Multi-channel**: Support customers across web, mobile, email, and social platforms
- **Scalable**: From small teams to enterprise deployments
- **Extensible**: Rich APIs and webhook system for custom integrations
- **Modern Stack**: Ruby on Rails backend, Vue.js frontend, PostgreSQL database
## Community & Support
Join our thriving community of developers and users:
- **GitHub**: [github.com/chatwoot/chatwoot](https://github.com/chatwoot/chatwoot)
- **Community Slack**: [chatwoot.com/slack](https://chatwoot.com/slack)
- **Discussions**: [GitHub Discussions](https://github.com/chatwoot/chatwoot/discussions)
- **Twitter**: [@chatwootapp](https://twitter.com/chatwootapp)
---
## Application APIs
Application APIs are designed for interacting with a Chatwoot account from an agent/admin perspective. Use them to build internal tools, automate workflows, or perform bulk operations like data import/export.
- **Authentication**: Requires a user `access_token`, which can be generated from **Profile Settings** after logging into your Chatwoot account.
- **Availability**: Supported on both **Cloud** and **Self-hosted** Chatwoot installations.
- **Example**: [Google Cloud Functions Demo](https://github.com/chatwoot/google-cloud-functions-demo)
---
## Client APIs
Client APIs are intended for building custom messaging experiences over Chatwoot. If you're not using the native website widget or want to embed chat in your mobile app, these APIs are the way to go.
- **Authentication**: Uses `inbox_identifier` (from **Settings → Configuration** in API inboxes) and `contact_identifier` (returned when creating a contact).
- **Availability**: Supported on both **Cloud** and **Self-hosted** Chatwoot installations.
- **Examples**:
- [Client API Demo](https://github.com/chatwoot/client-api-demo)
- [Flutter SDK](https://github.com/chatwoot/chatwoot-flutter-sdk)
---
## Platform APIs
Platform APIs are used to manage Chatwoot installations at the admin level. These APIs allow you to control users, roles, and accounts, or sync data from external authentication systems.
- **Authentication**: Requires an `access_token` generated by a **Platform App**, which can be created in the **Super Admin Console**.
- **Availability**: Available on **Self-hosted** / **Managed Hosting** Chatwoot installations only.
---
Use the right API for your use case, and you'll be able to extend, customize, and integrate Chatwoot into your stack with ease.
Ready to dive in? Choose your path above and let's build something amazing together! 🚀
@@ -0,0 +1,52 @@
---
title: Chatwoot Production Deployment Guide
description: Understanding Chatwoot's production architecture and deployment requirements
sidebarTitle: Architecture
---
This guide will help you to deploy Chatwoot to production!
## Architecture
Running Chatwoot in production requires the following set of services.
* Chatwoot web servers
* Chatwoot workers
* PostgreSQL Database
* Redis Database
* Email service (SMTP servers / SendGrid / Mailgun etc)
* Object Storage (S3, Azure Storage, GCS, etc)
![architecture](/self-hosted/images/architecture.png)
## Updating your Chatwoot installation
A new version of Chatwoot is released around the first Monday of every month. We also release minor versions when there is a need for hotfixes or security updates.
You can stay tuned to our [Roadmap](https://github.com/chatwoot/chatwoot/milestones) and [releases](https://github.com/chatwoot/chatwoot/releases) on GitHub. We recommend you to stay up to date with our releases to enjoy the latest features and security updates.
The deployment process for a newer version involves updating your app servers and workers with the latest code. Most updates would involve database migrations as well which can be executed through the following Rails command.
```bash
bundle exec rails db:migrate
```
The detailed instructions can be found in respective deployment guides.
## Available deployment options
If you want to self host Chatwoot, the recommended approach is to use one of the recommended one click installation options from the below list. If you are comfortable with Ruby on Rails applications, you can also make use of the other deployment options mentioned below.
* **[Heroku](/self-hosted/deployment/heroku)** (recommended)
* **[Docker](/self-hosted/deployment/docker)** (recommended)
* **[Linux](/self-hosted/deployment/linux-vm)**
* **[Kubernetes](/self-hosted/deployment/kubernetes)**
* **[Chatwoot CTL](/self-hosted/deployment/chatwoot-ctl)**
### Cloud Providers
* **[AWS](/self-hosted/cloud/aws)**
* **[Azure](/self-hosted/cloud/azure)**
* **[DigitalOcean](/self-hosted/cloud/digitalocean)**
* **[Google Cloud](/self-hosted/cloud/gcp)**
* **[Heroku](/self-hosted/cloud/heroku)**
@@ -0,0 +1,170 @@
---
title: AWS Marketplace AMI Deployment
description: Deploy Chatwoot on AWS using the marketplace AMI listing
sidebarTitle: AWS Marketplace
---
# AWS Chatwoot Deployment Guide
The following is the guide for deploying Chatwoot on AWS using the marketplace listing. Use our helm charts with AWS Elastic Kubernetes Service(EKS) for a cloud-native deployment.
## Prerequisites
- AWS account
## Install Chatwoot via AWS Marketplace AMI
### Step 1: Subscribe to Chatwoot
1. Go to [Chatwoot AWS marketplace listing](https://aws.amazon.com/marketplace/pp/prodview-tolblk4kmdqd4) and click on **Subscribe**.
![Subscribe to Chatwoot](/self-hosted/images/aws-ami/awsmp-01-subscribe.png)
### Step 2: Sign In
2. Sign in with your AWS account.
![AWS Sign In](/self-hosted/images/aws-ami/awsmp-02-signin.png)
### Step 3: Continue to Configuration
3. Click on **Continue to Configuration**.
![Continue to Configuration](/self-hosted/images/aws-ami/awsmp-03-continue.png)
### Step 4: Configure Software
4. Select the latest version in **Software Version** and pick your AWS **region**. Click **Continue to Launch**.
![Configure Software](/self-hosted/images/aws-ami/awsmp-04-configure.png)
### Step 5: Launch Configuration
5. Review the launch configuration. Leave the **Choose Action** field with the default value **Launch from Website**. Choose a VPC and subnet as per your AWS region preference.
![Launch Configuration](/self-hosted/images/aws-ami/awsmp-05-launch.png)
### Step 6: Create Security Group
6. Scroll down to the **Security Group** section and click **Create New Based On Seller Settings**.
![Create Security Group](/self-hosted/images/aws-ami/awsmp-06-sg.png)
### Step 7: Save Security Group
7. Save the new security group and choose it after creation.
![Save Security Group](/self-hosted/images/aws-ami/awsmp-07-sg.png)
### Step 8: Configure Key Pair
8. Pick a key pair you already have or create a new one in the region you are deploying. Click **Launch**.
![Configure Key Pair](/self-hosted/images/aws-ami/awsmp-08-keypair.png)
### Step 9: Launch Confirmation
9. AWS should now display a congratulations screen confirming that Chatwoot instance is launched successfully. Click on the **EC2 Console** link.
![Launch Confirmation](/self-hosted/images/aws-ami/awsmp-09-launch.png)
### Step 10: Wait for Instance
10. Wait for a few minutes to let the instance come up.
![Wait for Instance](/self-hosted/images/aws-ami/awsmp-10-ec2.png)
### Step 11: Get Public IP
11. Select the instance and copy the public IP.
![Get Public IP](/self-hosted/images/aws-ami/awsmp-11-public-ip.png)
### Step 12: Access Chatwoot
12. Visit `http://<your-public-ip>:3000`. This should bring up the Chatwoot UI. Congratulations. Woot! Woot!!
![Access Chatwoot](/self-hosted/images/aws-ami/awsmp-12-chatwoot.png)
## Configuring Chatwoot
To configure Chatwoot, we need to SSH into the instance. We will use **AWS Console Connect** for this.
### Step 1: Connect to Instance
1. Select the instance and click on **Connect**.
![Connect to Instance](/self-hosted/images/aws-ami/awsmp-13-connect.png)
### Step 2: Use Ubuntu User
2. Change the username from `root` to `ubuntu` and click **Connect**.
![Use Ubuntu User](/self-hosted/images/aws-ami/awsmp-14-connect.png)
### Step 3: Configure Environment Variables
3. Switch to the `chatwoot` user and configure the necessary environment variables. Refer to [Environment variables](/self-hosted/configuration/environment-variables) document for the complete list.
```bash
sudo -i -u chatwoot
cd chatwoot
vi .env
```
<Note>
It is recommended to configure a proxy server like Nginx and set up SSL. Make sure to modify the security group created in step 6 accordingly.
</Note>
## Updating the Instance
Please follow the Chatwoot update process in the standard [Linux VM setup](/self-hosted/deployment/linux-vm).
## Security Recommendations
### SSL Configuration
- Set up SSL certificates using Let's Encrypt or AWS Certificate Manager
- Configure Nginx as a reverse proxy
- Update security group rules to allow HTTPS traffic (port 443)
### Access Control
- Restrict SSH access to specific IP addresses
- Use IAM roles for EC2 instances where possible
- Enable AWS CloudTrail for audit logging
### Backup Strategy
- Set up automated EBS snapshots
- Configure database backups
- Store backups in S3 with appropriate lifecycle policies
## Troubleshooting
### Common Issues
<Accordion title="Instance not accessible">
**Problem**: Cannot access Chatwoot on port 3000
**Solutions**:
- Check security group allows inbound traffic on port 3000
- Verify instance is running and healthy
- Check if Chatwoot service is running: `sudo systemctl status chatwoot`
</Accordion>
<Accordion title="Application not starting">
**Problem**: Chatwoot service fails to start
**Solutions**:
- Check logs: `sudo journalctl -u chatwoot -f`
- Verify environment variables are correctly set
- Ensure database connection is working
- Check disk space and memory usage
</Accordion>
### Support Resources
- [AWS Support](https://aws.amazon.com/support/)
- [Chatwoot Community Discord](https://discord.com/invite/cJXdrwS)
- [GitHub Issues](https://github.com/chatwoot/chatwoot/issues)
---
The AWS Marketplace AMI provides a quick way to deploy Chatwoot with pre-configured settings. For production use, ensure you implement proper security measures and backup strategies.
+277
View File
@@ -0,0 +1,277 @@
---
title: AWS Chatwoot deployment guide
description: Deploy Chatwoot on AWS with a reference HA architecture
sidebarTitle: Manual Install
---
The following is a reference HA architecture guide for deploying Chatwoot on AWS. For a cloud-native deployment, use our [helm charts](https://github.com/chatwoot/charts) with AWS Elastic Kubernetes Service(EKS).
## Introduction
We will use the Linux installation script to get a chatwoot instance running. Also instead of
relying on Redis, Postgres and Nginx installed in the same ec2; we will proceed to make use
of managed AWS services for the same viz Elasticache, RDS, and ALB.
### Prerequisites
1. AWS account
2. Domain to use with Chatwoot
### Architecture
This guide will follow a standard 3-tier architecture on AWS.
![aws-architecture](/self-hosted/images/aws-01-architecture.png)
## Network
### Create VPC
1. Sign in to the AWS console and pick the region you will deploy.
2. Navigate to the VPC console and create a new vpc for chatwoot. At the `name` tag, enter
`chatwoot-vpc` and use the CIDR block `10.0.0.0/16`.
3. Leave the rest of the options as default and click on `Create VPC`.
![aws-create-vpc](/self-hosted/images/aws-02-create-vpc.png)
### Subnets
Create two public and private subnets in the vpc we created. Make sure to have them in different AZ's and have non-overlapping CIDR ranges.
1. Navigate to VPC > Subnets.
2. Click on `Create Subnet`. Select the `chatwoot-vpc` we created before, name it as `chatwoot-public-1`, select an availability zone (for example, ap-south-1a), and the CIDR block as
`10.0.0.0/24`.
![aws-create-subnet](/self-hosted/images/aws-03-create-subnet.png)
3. Follow the same to create the remaining subnets.
| Name | Type | Availability Zone | CIDR Block |
| ------------------- | -------- | ------------------ | ------------- |
| `chatwoot-public-1` | public | `ap-south-1a` | `10.0.0.0/24` |
| `chatwoot-public-2` | public | `ap-south-1b` | `10.0.1.0/24` |
| `chatwoot-private-1` | private | `ap-south-1a` | `10.0.2.0/24` |
| `chatwoot-private-2` | private | `ap-south-1b` | `10.0.3.0/24` |
4. After creating all subnets, enable `auto assign public ipv4 address` for public subnets under `Actions` > `Subnet Settings`.
### Internet Gateway
1. Select `Create Internet Gateway` , name it `chatwoot-igw`, and click create.
2. Select it from the internet gateways list, choose actions and then select `Attach to VPC`.
3. Choose `chatwoot-vpc` and click attach.
![aws-create-igw](/self-hosted/images/aws-04-create-igw.png)
### NAT Gateway
Chatwoot app servers need to be deployed in the private subnet. For them to access the internet, we need to add NAT gateways to our public subnet and add a route from the private subnets.
1. Navigate the VPC dashboard and select `NAT gateways`.
2. Click `Create NAT Gateway`.
1. Name it `chatwoot-nat-1`.
2. Select the `chatwoot-public-1` subnet.
3. Click on `Allocate Elastic IP`.
4. Add additional tags as per your need.
5. Click `Create NAT gateway`.
![aws-create-nat](/self-hosted/images/aws-05-create-nat.png)
3. Follow the same to create a second NAT gateway (`chatwoot-nat-2`) and choose the `chatwoot-public-2` subnet.
### Route tables
The route table controls the inbound and outbound access for a subnet.
#### Public Route table
We will create route tables so that our public subnets can reach the internet via the Internet gateway.
Navigate to the VPC dashboard and select `Route Tables`.
1. Click `Create route table`.
2. Use the name `chatwoot-public-rt` and choose `chatwoot-vpc` under VPC.
3. Click `Create`.
![aws-create-rt](/self-hosted/images/aws-06-create-rt.png)
Next, we need to add a route to the internet gateway we created earlier(`chatwoot-igw`).
1. Select the `chatwoot-public-rt` route table from the list and click on `Edit routes` > `Add Route`.
2. Set the destination as `0.0.0.0/0` and choose the target as `chatwoot-igw`. Click on `Save Changes`.
Also,
1. Select the `chatwoot-public-rt` route table from the list and click on `Subnet Associations` > `Edit subnet associations`.
2. Select both the public subnets(`chatwoot-public-1`,`chatwoot-public-2`) and click `save`.
#### Private Route table
We will also create private route tables so that our private subnets can reach the internet via the NAT gateways.
1. Follow the above guide and create two private route tables, namely, `chatwoot-private-a` and `chatwoot-private-b`.
2. Select the route tables and add a route to the NAT gateway in their respective availability zone.
1. For `chatwoot-private-a`, add a route to `0.0.0.0/0` and target as `chatwoot-nat-1`.
2. For `chatwoot-private-b`, add a route to `0.0.0.0/0` and target as `chatwoot-nat-2`.
Also,
1. Associate the private route tables with corresponding private subnets.
1. For `chatwoot-private-a`, associate `chatwoot-private-1` subnet.
2. For `chatwoot-private-b`, associate `chatwoot-private-2` subnet.
## Application Load Balancer (ALB)
Create an application load balancer to receive traffic on port 80 and 443 and distribute it across Chatwoot instances.
1. Navigate to the EC2 section and choose the Load Balancer section.
2. Click `Create Load Balancer`.
1. Choose `Application Load Balancer`.
2. For the load balancer name, use `chatwoot-loadbalancer`.
3. Select the scheme as `internet-facing` and IP address type as `IPv4`.
4. For the network mapping section,
1. Select `chatwoot-vpc`.
2. Select the public subnets `chatwoot-public-1` and `chatwoot-public-2` under the mapping section.
5. For the Security group section,
1. Create a new security group, `chatwoot-loadbalancer-sg`.
2. Add rules to allow HTTP and HTTPS traffic from anywhere(`0.0.0.0/0`, `::/0`).
3. Also, add a rule to allow TCP on port 3000. This rule allows the load balancer health checks to pass since Chatwoot runs on port 3000.
4. Add a rule to allow SSH traffic from the bastion security group we will create at the latter stage of the guide. Revisit this section after completing the bastion step.
6. For the Listeners and routing section, create two listeners for 80 and 443. Set the forwarding rule on listener 80 to redirect `http` to `https`.
1. Also, create a target group, `chatwoot-tg`, that will forward the requests to port `3000`(Chatwoot listens on this port).
2. Add a health check to the endpoint `/api`. This endpoint is not authenticated and should return the application version.
```
{
"version": "1.22.1",
"timestamp": "2021-12-06 16:07:39"
}
```
7. Add any necessary tags and click create.
Also, add if you have your domain on Route53 and use ACM to generate a certificate to use with ALB.
## Postgresql using AWS RDS
Chatwoot uses Postgres as a DB layer, and we will use Amazon RDS with a multi-AZ option for reliability.
### RDS security group
1. Navigate to EC2 > Security groups and create a new sg.
2. Name it `chatwoot-rds-sg`.
3. Select the `chatwoot-vpc` and add an inbound rule for postgres port with source `chatwoot-loadbalancer-sg`.
### RDS subnet group
1. Navigate to the RDS section and select subnet groups.
2. Create `chatwoot-rds-group` and choose `chatwoot-vpc`.
3. Select both az's and the private subnets.
### RDS
1. Select create a database.
2. Use standard create and choose the Postgres engine.
3. Use the production template, and create a Postgres master username and password.
4. Enable Multi-AZ deployment.
5. Select `chatwoot-vpc` and select the rds security group we created earlier.
6. Enable password authentication.
7. Click create.
8. After completing the creation, note down the hostname, username, and password. We will need this to configure Chatwoot.
## Redis using AWS Elasticache
1. Follow similar steps like the rds to create Redis security and subnet groups.
2. Create the Redis cluster with a multi-AZ option.
## Creating Bastion servers
Create bastion servers in both public subnets. These servers will be used to ssh into Chatwoot servers in private subnets.
1. Navigate to the EC2 dashboard and click launch instance.
2. Use an `Ubuntu 20.04 image` with a `t3.micro` type.
3. Choose `chatwoot-vpc` and subnet `chatwoot-public-1`.
4. Name it `chatwoot-bastion-a`.
5. Add a new sg, `chatwoot-bastion-sg` and enable ssh access from anywhere.
6. Leave the rest as defaults and click launch.
7. Once the instance is up, try to SSH into the instance.
Repeat and create another bastion, `chatwoot-bastion-b` in the other AZ.
## Install Chatwoot
1. Navigate to the EC2 section, and click on launch instance.
2. Use an `Ubuntu 20.04 image` with a `c5.xlarge` instance type.
3. Choose the chatwoot-vpc and select the private subnet `chatwoot-private-1`.
4. Disable auto-assign public IP and increase the storage of root volume to 60 GB.
5. Add necessary tags. Set the `Name` tag to `chatwoot`.
6. Select the load balancer security group and click launch.
7. SSH into the bastion server and, from there, ssh to the chatwoot instance we created.
8. Switch to the `root` user.
9. Download the chatwoot Linux installation script.
```bash
wget https://get.chatwoot.app/linux/install.sh
chmod 755 install.sh
```
10. Run the script.
```bash
./install.sh --install
```
## Configure Chatwoot
11. Once the installation is complete, switch to the chatwoot user and navigate to the chatwoot folder. Edit the .env file and replace the Postgres and Redis credentials with RDS and elasticache values.
```bash
sudo -i -u chatwoot
cd chatwoot
vi .env
```
12. Run the db migration.
```bash
RAILS_ENV=production bundle exec rake db:prepare
```
13. Also modify the other necessary environment variable for your chatwoot setup. Refer to https://www.chatwoot.com/docs/self-hosted/deployment/linux-vm#configure-the-required-environment-variables
14. Restart the `chatwoot` service.
```bash
sudo cwctl --restart
```
## Verify login
15. Add this instance to the target group attached to the alb.
16. Navigate to your chatwoot domain to see if everything is working.
## Create a custom AMI
1. If you are getting the onboarding page, complete the signup and verify the installation.
2. Voila !! Your chatwoot instance is up.
3. If everything looks good, proceed to create an ami from this instance and name it `chatwoot-base-ami`.
## Auto Scaling Groups (ASG)
1. Create a launch configuration using the above base image.
2. Proceed to create an auto-scaling group from this launch config.
3. Set the minimum and desired capacity to 2 and the maximum to 4. Modify this as per your requirement.
4. Create a scaling policy based on CPU utilization.
5. At this point, we are good to terminate the instance we created earlier.
6. Check the load balancer or target group to verify if two new chatwoot instances have come up.
7. That's it.
## Monitoring
1. Refer to https://www.chatwoot.com/docs/self-hosted/monitoring/apm-and-error-monitoring
## Updating Chatwoot
1. log in to one of the application servers and complete the update instructions. Run migrations if needed. Refer to https://www.chatwoot.com/docs/self-hosted/deployment/linux-vm#upgrading-to-a-newer-version-of-chatwoot
2. Create a new ami and update the launch config.
## Conclusion
This document is a reference guideline for an HA chatwoot architecture on AWS. Modify or build upon this to suit your requirements.
@@ -0,0 +1,41 @@
---
title: Azure Chatwoot deployment guide
description: Deploy Chatwoot on a single VM in Azure
sidebarTitle: Azure
---
This guide will deploy chatwoot on a single VM in Azure. For a cloud native deployment, use our [helm charts](https://github.com/chatwoot/charts) with Azure Kubernetes Service(AKS).
<Note>
This guide is a work in progress and your mileage may vary.
</Note>
## Create a Virtual Machine
1. Login to the Azure portal and choose Virtual Machines.
2. Select create a VM from scratch.
3. In the Basics tab, create a subscription and a new resource group.
4. Name the virtual machine as `chatwoot` and select your preferred region.
5. Select `Ubuntu 20.04 LTS - Gen2` as the image.
6. For instance size, we recommend the type `Standard_D4s_v3`(4vCPU, 16GB RAM).
7. Under authentication, leave the defaults and create a new key pair if needed.
8. Allow HTTP, HTTPS and SSH under inbound port rules.
9. Click next and leave the defaults for Disks, Networking, Management, Advanced and Tags section.
10. Select `Review + create` to spin up the VM.
![azure-create-vm](/self-hosted/images/azure.png)
## Install Chatwoot
1. SSH into the instance created from your local machine or create a bastion in azure to ssh via the browser.
2. Follow the linux VM instructions at https://www.chatwoot.com/docs/self-hosted/deployment/linux-vm.
3. Woot! Woot! Your Chatwoot Instance is ready and can be accessed at `http://<your-instance-ip>:3000`. Or if you completed the domain setup during the installation, chatwoot should be available at `https://<your-domain>`.
<Note>
Browser access via port 3000 will only work if enabled under inbound rules.
</Note>
## Configure Chatwoot
1. Follow the Chatwoot docs to configure your domain, email and other parameters you need.
https://www.chatwoot.com/docs/self-hosted/deployment/linux-vm#configure-the-required-environment-variables
@@ -0,0 +1,106 @@
---
title: Caprover Chatwoot Production deployment guide
description: Deploy Chatwoot using Caprover's one-click application management
sidebarTitle: Caprover
---
## Caprover Overview
Caprover is an extremely easy to use application server management tool. It is blazing fast and uses Docker under the hood. Chatwoot has been made available as a one-click app in Caprover, and the deployment process is straightforward.
<Note>
This is a community contributed installation setup. This will only have community support for any issues in future.
</Note>
## Setup Chatwoot Using Caprover
### 1. Install Caprover on your VM
Finish your Caprover installation by referring to [Getting started guide](https://caprover.com/docs/get-started.html).
### 2. Install Chatwoot
Chatwoot is available in the one-click apps option in Caprover. Search for Chatwoot in the list of one-click apps. Replace the default `version` with the latest `version` of chatwoot. Use appropriate values for the Postgres and Redis passwords and click install. It should only take a few minutes.
### 3. Finish the setup
Head over to the `web` service in the Caprover applications and enable `Websocket Support` in the HTTP settings to true. You could also enable `https` for the application.
![caprover-enable-websocket](/self-hosted/images/caprover-websocket.png)
### 4. Configure environment variables
Caprover will take care of Postgres and Redis installation, along with the app and worker servers. We would advise you to replace the Database/Redis services with managed/standalone servers once you start scaling.
Also, ensure to set the appropriate environment variables for email, Object Store service etc. using our [Environment variables guide](/docs/self-hosted/configuration/environment-variables)
<Note>
Chatwoot requires websocket support. Do enable it from `chatwoot-web` settings page in Caprover.
</Note>
## Upgrading Chatwoot installation
To update your chatwoot installation to the latest version in Caprover, run the following command in the deployment tab for web and worker in `method 5: deploy captain-definition`. Make sure to replace `[DESIRED VERSION HERE]` with the current latest stable version. Check [here](https://www.chatwoot.com/changelog/) and [here](https://hub.docker.com/r/chatwoot/chatwoot/tags) for possible version numbers first.
### web
```json
{
"schemaVersion": 2,
"dockerfileLines": [
"FROM chatwoot/chatwoot:[DESIRED VERSION HERE]",
"RUN chmod +x docker/entrypoints/rails.sh",
"ENTRYPOINT [\"docker/entrypoints/rails.sh\"]",
"CMD bundle exec rake db:chatwoot_prepare; bundle exec rails s -b 0.0.0.0 -p 3000"
]
}
```
### worker
```json
{
"schemaVersion": 2,
"dockerfileLines": [
"FROM chatwoot/chatwoot:[DESIRED VERSION HERE]",
"RUN chmod +x docker/entrypoints/rails.sh",
"ENTRYPOINT [\"docker/entrypoints/rails.sh\"]",
"CMD bundle exec sidekiq -C config/sidekiq.yml"
]
}
```
## Accessing Rails Console
Login to the server where you have caprover installed and execute the following commands.
```bash
# access the shell inside the container
docker exec -it $(docker ps --filter name=srv-captain--chatwoot-web -q) /bin/sh
# start rails console
RAILS_ENV=production bundle exec rails c
```
## Common Errors
### API requests failing with "You need to sign in or sign up before continuing."
Nginx by default strip of headers with `_` . Head over to the Nginx configuration option in caprover under the Chatwoot web and add the following directive.
Access the Caprover `web dashboard` > `Apps` > `Apps Edit` > `Edit Default Nginx Configurations`. Refer https://caprover.com/docs/nginx-customization.html for more details.
```nginx
# Nginx strips out underscore in headers by default
# Chatwoot relies on underscore in headers for API
# Make sure that the config is set to on.
underscores_in_headers on;
```
### Issues related to storage persistance
Please setup a cloud storage like s3 or gcs bucket or any s3 api compatible service as the active storage service.
Caprover installation needs this for storage persistance. Refer the [storage guide](/docs/self-hosted/deployment/storage/supported-providers).
## Further references
- https://isotropic.co/how-to-install-chatwoot-to-a-digitalocean-droplet/
@@ -0,0 +1,75 @@
---
title: Deploy Chatwoot to Clever Cloud
description: Deploy Chatwoot on Clever Cloud PaaS platform
sidebarTitle: Clever Cloud
---
Clever Cloud is a PaaS platform where you can deploy your applications with ease. To setup Chatwoot on Clever Cloud, you can follow the steps described below.
<Note>
This is a community contributed installation setup. This will only have community support for any issues in future.
</Note>
## 1. Create CleverCloud application
- Login to Clever Cloud dashboard
- Click on create an application
- Select your deployment type (> 2GB recommended)
- Provide an app name and select the zone
## 2. Select addons
Chatwoot requires PostgreSQL and Redis to function properly. Select Postgres and Redis from CleverCloud addons.
- Copy connection URI from Postgres Addon and set `DATABASE_URL` environment variable
- Make sure you have set REDIS_URL
## 3. Setup Clever cloud origin
- Clone Chatwoot project from Github
```bash
git clone git@github.com:chatwoot/chatwoot.git
```
- Set Clever Cloud origin
```bash
git remote add clever git+ssh://git@<id>.clever-cloud.com/<app-name>.git
```
## 4. Setup build hooks
To install the dependencies, you have to setup builds hooks. Set the following in the environment variables of the application.
```bash
CC_POST_BUILD_HOOK="RAILS_ENV=production rails assets:precompile"
CC_PRE_BUILD_HOOK="pnpm install"
CC_PRE_RUN_HOOK="rake db:chatwoot_prepare"
```
## 5. Push the latest changes
Push the latest code from your local machine to Clever Cloud.
```bash
git push clever master
```
Voila! After the deployment, you would be able to access the application.
## Environment Variables
Make sure you have the following environment variables configured in the application.
```bash
CC_POST_BUILD_HOOK="RAILS_ENV=production rails assets:precompile"
CC_PRE_BUILD_HOOK="pnpm install"
CC_PRE_RUN_HOOK="rake db:chatwoot_prepare"
DATABASE_URL="<postgres-addon-url>"
FRONTEND_URL="<clever-cloud-app-url>"
PORT="8080"
RAILS_ENV="production"
REDIS_URL="<redis-addon-url>"
SECRET_KEY_BASE="<long-secret-key>"
```
@@ -0,0 +1,41 @@
---
title: Cloudron Chatwoot deployment guide
description: Deploy Chatwoot using Cloudron's 1-click app platform
sidebarTitle: Cloudron
---
## Cloudron Overview
[Cloudron](https://cloudron.io) is a platform that makes it easy to install, manage and secure web apps on your server. Chatwoot is now available as a 1-click app in the Cloudron app store and the installation is blazing fast.
<Note>
This is a community contributed installation setup. This will only have community support for any issues in future.
</Note>
## Setup Chatwoot using Cloudron
### 1. Install Cloudron on your server
Finish your Cloudron installation by following the instructions at [Get Cloudron](https://www.cloudron.io/get.html).
### 2. Install Chatwoot
Once Cloudron installation is complete, login to your cloudron web portal and click on the appstore icon. Search for `Chatwoot` and click install. That's it. Chatwoot should be up and running in a minute or two.
Direct link to the cloudron app store listing --> https://www.cloudron.io/store/com.chatwoot.cloudronapp.html
### 3. Finish the setup
Navigate to your chatwoot domain and complete the onboarding setup.
### 4. Configure environment variables
Cloudron will take care of Postgres and Redis installation, along with the app and worker processes. We would advise you to replace the Database/Redis services with managed/standalone servers once you start scaling.
Also, ensure to set the appropriate environment variables for email, Object Store service etc. using our [Environment variables guide](/docs/self-hosted/configuration/environment-variables).
Custom environment variables can be set in `/app/data/env` using the Cloudron File manager. Be sure to reboot the app after making any changes.
## Upgrading Chatwoot installation
Chatwoot follows a monthly release pattern with a new release every 15th of the month. Use the built in [Cloudron app updates](https://docs.cloudron.io/updates/) to stay on the latest version. Read about the changelog [here](https://www.chatwoot.com/changelog/).
@@ -0,0 +1,31 @@
---
title: DigitalOcean Chatwoot deployment guide
description: Deploy Chatwoot on a single droplet in DigitalOcean
sidebarTitle: DigitalOcean
---
This guide will deploy chatwoot on a single droplet in DigitalOcean. For a cloud native deployment, go with
our [1-click k8s app on DigitalOcean Marketplace](https://marketplace.digitalocean.com/apps/chatwoot).
## Create a Droplet (VM)
1. Login to DigitalOcean console and choose create droplet.
2. Choose `Ubuntu 20.04` image.
3. Create an instance with a minimum of 4vCPU and 8GB RAM.
4. Make sure to choose the datacenter region you want to deploy.
5. Under authentication, choose your SSH key or create a new one. This is important as you will need
this key to complete the next section.
6. Click create.
![do-create-droplet](/self-hosted/images/do.png)
## Install Chatwoot
1. SSH into the droplet created above.
2. Follow the linux VM instructions at https://www.chatwoot.com/docs/self-hosted/deployment/linux-vm.
3. Woot! Woot! Your Chatwoot Instance is ready and can be accessed at `http://<your-droplet-ip>:3000`. Or if you completed the domain setup during the installation, chatwoot should be available at `https://<your-domain>`
## Configure Chatwoot
1. Follow the Chatwoot docs to configure your domain, email and other parameters you need.
https://www.chatwoot.com/docs/self-hosted/deployment/linux-vm#configure-the-required-environment-variables
@@ -0,0 +1,16 @@
---
title: Deploying Chatwoot on Easypanel
description: Deploy Chatwoot using Easypanel's modern server control panel
sidebarTitle: Easypanel
---
[Easypanel](https://easypanel.io) it's a modern server control panel. You can use it to deploy Chatwoot on your own server.
[![Deploy to Easypanel](https://easypanel.io/img/deploy-on-easypanel-40.svg)](https://easypanel.io/docs/templates/chatwoot)
## Instructions
1. Create a VM that runs Ubuntu on your cloud provider.
2. Install Easypanel using the instructions from the website.
3. Create a new project.
4. Install Chatwoot using the dedicated template.
@@ -0,0 +1,43 @@
---
title: Elestio Chatwoot fully managed deployment guide
description: Deploy Chatwoot with Elestio's fully managed platform
sidebarTitle: Elestio
---
## Deploy to Elestio with one-click
[![Deploy](https://pub-da36157c854648669813f3f76c526c2b.r2.dev/deploy-on-elestio-black.png)](https://elest.io/open-source/chatwoot)
## Select the providers
- Select cloud service provider of your choice.
- Choose region of your choice
- Select service plan. The smallest one offers 1 CPU, 2 GB RAM etc.
- Confirm the details and hit "Next"
![Elestio Setup](/self-hosted/images/elestio.png)
## Configure
- Select the support level
- Name your application
- Add admin email (You can add email you want to access your application from)
- Click "Create Service"
- Here you also get option to copy your terraform config (Optional)
## Use Chatwoot
- Click on "Display Admin UI"
- Go to Admin Ui link provided
- Add username and password provided on dashboard.
![Elestio Dashboard](/self-hosted/images/elestio-dash.png)
## Update Chatwoot
- Go to Overview section in your Chatwoot service
- Click "Change version" inside Software section
- Choose the latest version or the version of your choice.
- Additionally update the configs or restart the instance with single clink under same section
![Elestio Change version](/self-hosted/images/elestio-version.png)
+32
View File
@@ -0,0 +1,32 @@
---
title: GCP Chatwoot deployment guide
description: Deploy Chatwoot on a single VM in GCP
sidebarTitle: GCP
---
This guide will deploy chatwoot on a single VM in GCP. For a cloud native deployment, use our [helm charts](https://github.com/chatwoot/charts) with Google Kubernetes Engine(GKE).
<Note>
This guide is a work in progress and your mileage may vary.
</Note>
## Create Compute Engine (VM)
1. Navigate to VM > Compute Engine window.
2. Create an instance with a minimum of 4vCPU and 8GB RAM.(N2 General-Purpose)
3. Make sure to select the correct region you want to deploy.
4. Choose `Ubuntu 20.04` as your OS with a 120GB disk.
5. Click create.
![gcp-create-compute-engine](/self-hosted/images/gcp.png)
## Install Chatwoot
1. SSH into the instance created.
2. Follow the linux VM instructions at https://www.chatwoot.com/docs/self-hosted/deployment/linux-vm.
3. Woot! Woot! Your Chatwoot Instance is ready and can be accessed at `http://<your-instance-ip>:3000`. Or if you completed the domain setup during the installation, chatwoot should be available at `https://<your-domain>`
## Configure Chatwoot
1. Follow the Chatwoot docs to configure your domain, email and other parameters you need.
https://www.chatwoot.com/docs/self-hosted/deployment/linux-vm#configure-the-required-environment-variables
@@ -0,0 +1,49 @@
---
title: Heroku Chatwoot Production Deployment Guide
description: Deploy Chatwoot on Heroku with one-click deployment
sidebarTitle: Heroku
---
# Deploying on Heroku
<Note>
Heroku has discontinued free dynos, postgres and redis. [Chatwoot will use basic/mini plans](https://blog.heroku.com/new-low-cost-plans) for all new Heroku deployments going forward.
</Note>
Deploy Chatwoot on Heroku through the following steps:
1. Click on the [one click deploy button](https://heroku.com/deploy?template=https://github.com/chatwoot/chatwoot/tree/master) and deploy your app.
2. Go to the **Resources** tab in the Heroku app dashboard and ensure the worker dynos is turned on.
3. Head over to **Settings** tab in Heroku app dashboard and click **Reveal Config Vars**.
4. Configure the environment variables for [mailer](/self-hosted/configuration/environment-variables#configure-emails) and [storage](/self-hosted/deployment/storage/supported-providers) as per the [documentation](/self-hosted/configuration/environment-variables).
5. Head over to `yourapp.herokuapp.com` and enjoy using Chatwoot.
<iframe
frameBorder="0"
scrolling="no"
marginHeight="0"
marginWidth="0"
width="100%"
height="443"
type="text/html"
src="https://www.youtube-nocookie.com/embed/iN2Dl0QkvEg?autoplay=0&fs=0&iv_load_policy=3&showinfo=1&rel=0&cc_load_policy=0&start=0&end=0&origin=https://youtubeembedcode.com">
</iframe>
## Updating the deployment on Heroku
Whenever a new version is out for Chatwoot, you update your Heroku deployment through following steps:
1. In the **Deploy** tab, choose `GitHub` as the deployment option.
2. Connect Chatwoot repo to the app.
3. Head over to the manual deploy option, choose `master` branch and hit **Deploy**.
## Known Limitations
1. **Dyno Sleep**: If you are on a free tier and you don't access the application for a while Heroku will put your dynos to sleep. You can fix this by upgrading the dynos to paid tier.
2. **Ephemeral Storage**: Heroku has an "ephemeral" hard disk. The files uploaded to Chatwoot would not persist after the application is restarted. By default, Chatwoot uses local disk as the upload destination. To overcome this problem, you will have to [configure a cloud storage](/self-hosted/deployment/storage/supported-providers).
3. **Build Version**: If the build version is shown as unknown on the settings page, enable the runtime dyno metadata feature. To enable, use:
```bash
heroku labs:enable runtime-dyno-metadata -a <app-name>
```
@@ -0,0 +1,101 @@
---
title: Restack Chatwoot production deployment guide
description: Deploy Chatwoot on AWS with Restack's managed Kubernetes platform
sidebarTitle: AWS with Restack
---
## Getting Started
To deploy Chatwoot with Restack:
- [Sign up for a Restack account](#sign-up-for-a-restack-account).
- [Add AWS credentials with AdministratorAccess](#add-aws-credentials-with-administratoraccess).
- [One-click cluster creation with Restack](#one-click-cluster-creation-with-restack).
- [Deploy Chatwoot on Restack](#deploy-chatwoot-on-restack).
- [Start using Chatwoot](#start-using-chatwoot).
- [Deploy multiple instances of Chatwoot](#deploy-multiple-instances-of-chatwoot).
<Note>
This is a community contributed installation setup. This will only have community support for any issues in future.
</Note>
## Sign up for a Restack account
To Sign up for a Restack account, visit [www.restack.io/signup](https://www.restack.io/signup). You can sign up with your corporate email address or your GitHub profile. You do not need a credit card to sign up.
![restack-signup](/self-hosted/images/restack-sign-up.png)
If you already have an account, go ahead and login to Restack at [www.restack.io/login](https://www.restack.io/login).
## Add AWS credentials with AdministratorAccess
To deploy Chatwoot in your own AWS infrastructure with Restack, you will need to add your credentials as the next step.
Make sure that this account has *AdministratorAccess*. This is how Restack can ensure an end-to-end cluster creation and cluster management process.
1. Navigate to *Clusters* in the left-hand navigation menu.
2. Select the *Credentials* tab.
3. Click *Add credential*.
![add-credentials](/self-hosted/images/Add_credentials.png)
4. Give a suitable title to your credentials for managing them later.
5. Enter your *AWS Access Key ID* and *AWS Secret Access key*.
6. Click *Add credential*.
![add-aws-credentials](/self-hosted/images/Add_AWS_Creds.png)
<Tip>
[How to get your AWS Access key ID and AWS Secret Access Key](https://docs.aws.amazon.com/accounts/latest/reference/root-user-access-key.html)
</Tip>
## One-click cluster creation with Restack
<Tip>
Why do I need a cluster?<br/>
Running your application on a Kubernetes cluster lets you deploy, scale and monitor the application reliably.
</Tip>
Once you have added your credentials,
1. Navigate to the *Clusters* tab on the same page and click on *Create cluster*.
![create-cluster](/self-hosted/images/Create_cluster.png)
2. Give a suitable name to your cluster.
3. Select the region you want to deploy the cluster in.
4. Select the AWS credentials you added in the previous step.
![cluster-details](/self-hosted/images/Cluster_details.png)
The cluster creation process will start automatically. Once the cluster is ready, you will get an email on the email id connected with your account.<br/>Creating a cluster is a one-time process. From here you can add other open source tools or multiple instances of Chatwoot in the same cluster.
![creating-cluster](/self-hosted/images/Creating_cluster.png)
![cluster-created](/self-hosted/images/Cluster_created.png)
Any application you deploy in your cluster will be accessible via a free **restack domain**.<br/>Contact the Restack team via chat to set a custom domain for your Chatwoot instances.
## Deploy Chatwoot on Restack
1. Click *Add application* from the Cluster description or go to the Applications tab in the left hand side navigation.
2. Click *Chatwoot*.
![select-chatwoot](/self-hosted/images/Select_Chatwoot.png)
3. Select the cluster you have already provisioned.
4. Click *Add application*.
## Start using Chatwoot
Chatwoot will be deployed on your cluster and you can access it using the link under the *URL* tab.
![chatwoot-deployed](/self-hosted/images/Chatwoot_deployed.png)
You can also check the workloads and volumes that are deployed within Chatwoot.
![access-chatwoot](/self-hosted/images/Chatwoot_access.png)
## Deploy multiple instances of Chatwoot
Restack makes it easier to deploy multiple instances of Chatwoot on the same or multiple clusters.<br/>So you can test the latest version before upgrading or have a dedicated instance for development and for production.
@@ -0,0 +1,264 @@
---
title: Environment Variables
description: Complete reference for Chatwoot environment variables and configuration options
sidebarTitle: Environment Variables
---
## The .env File
We use the `dotenv-rails` gem to manage the environment variables. There is a file called `env.example` in the root directory of this project with all the environment variables set to empty values. You can set the correct values as per the following options. Once you set the values, you should rename the file to `.env` before you start the server.
## Configure frontend URL (domain)
Provide your chatwoot domain as frontend URL.
```bash
FRONTEND_URL='https://your-chatwoot-domain.tld'
```
## Rails production variables
For production deployment, you have to set the following variables
```bash
RAILS_ENV=production
SECRET_KEY_BASE=replace_with_your_own_secret_string
```
You can generate `SECRET_KEY_BASE` using `rake secret` command from the project root folder. If you dont have rails installed, use `head /dev/urandom | tr -dc A-Za-z0-9 | head -c 63 ; echo ''`.
<Note>
SECRET_KEY_BASE should be alphanumeric. Avoid special characters or symbols.
</Note>
## Database configuration
Postgres can be configured in two ways: via `DATABASE_URL` or setting up independent Postgres variables.
### Configure Postgres
Set the `DATABASE_URL` variable with value as Postgres connection URI to connect to the database.
The URI is of the format
```bash
postgresql://[user[:password]@][netloc][:port][,...][/dbname][?param1=value1&...]
```
Or you can set the following environment variables to configure Postgres. Replace the values here with yours. Skip this
if you have configured `DATABASE_URL`.
```bash
POSTGRES_HOST=localhost
POSTGRES_PORT=5432
POSTGRES_DATABASE=chatwoot_production
POSTGRES_USERNAME=admin
POSTGRES_PASSWORD=password
```
### Configure Redis
For development, you can use the following URL to connect to Redis. For production, configure your Redis URL.
```bash
REDIS_URL='redis://127.0.0.1:6379'
```
To authenticate Redis connections made by the app server and sidekick, if it's protected by a password, use the following environment variable to set the password.
```bash
REDIS_PASSWORD=
```
## Configure emails
For development, you don't need an email provider. Chatwoot uses the [letter-opener](https://github.com/ryanb/letter_opener) gem to test emails locally
For production use, please configure the following variables.
```bash
# could user either `email@yourdomain.com` or `BrandName <email@yourdomain.com>`
MAILER_SENDER_EMAIL=
```
and based on your SMTP server the following variables
```bash
SMTP_ADDRESS=
SMTP_USERNAME=
SMTP_PASSWORD=
SMTP_TLS=
SMTP_SSL=
```
### Postfix
Follow these steps if you want to use a selfhosted mail server with Chatwoot. This is the default behavior starting from `v2.12.0` and relies on `SMTP_ADDRESS` environment variable not being set.
```
sudo apt install -y postfix
```
Choose internet-site when prompted and enter the domain name you used with Chatwoot setup for `System mail name`.
<Note>
By default, all major cloud provider have blocked port 25 used for sending emails as part of their spam combat effects. Please raise a support ticket with your cloud provider to enable outbound access on port 25 for this to work. Refer [AWS](https://aws.amazon.com/premiumsupport/knowledge-center/ec2-port-25-throttle), [GCP](https://cloud.google.com/compute/docs/tutorials/sending-mail), [Azure](https://learn.microsoft.com/en-us/azure/virtual-network/troubleshoot-outbound-smtp-connectivity) and [DigitalOcean](https://www.digitalocean.com/blog/smtp-restricted-by-default) for more details.
</Note>
Also please add MX and PTR records for your domain. If your emails are being flagged by `Gmail` and `Outlook`, setup [SPF and DKIM records](https://www.linuxbabe.com/mail-server/setting-up-dkim-and-spf) for your domain as well. This should improve your email reputation.
### Amazon SES
```bash
SMTP_ADDRESS=email-smtp.<region>.amazonaws.com
SMTP_AUTHENTICATION=plain
SMTP_ENABLE_STARTTLS_AUTO=true
SMTP_USERNAME=<Your SMTP username>
SMTP_PASSWORD=<Your SMTP password>
```
### SendGrid
<Info>
For clarification, the `SMTP_USERNAME` should be set to the literal text apikey—this is not the actual API key. SendGrid uses 'apikey' as the standard username for its services.
</Info>
```bash
SMTP_ADDRESS=smtp.sendgrid.net
SMTP_AUTHENTICATION=plain
SMTP_DOMAIN=<your verified domain>
SMTP_ENABLE_STARTTLS_AUTO=true
SMTP_PORT=587
SMTP_USERNAME=apikey
SMTP_PASSWORD=<your Sendgrid API key>
```
### MailGun
```bash
SMTP_ADDRESS=smtp.mailgun.org
SMTP_AUTHENTICATION=plain
SMTP_DOMAIN=<Your domain, this has to be verified in Mailgun>
SMTP_ENABLE_STARTTLS_AUTO=true
SMTP_PORT=587
SMTP_USERNAME=<Your SMTP username, view under Domains tab>
SMTP_PASSWORD=<Your SMTP password, view under Domains tab>
```
### Mandrill
If you would like to use Mailchimp to send your emails, use the following environment variables:
<Note>
Mandrill is the transactional email service for Mailchimp. You need to enable transactional email and login to mandrillapp.com.
</Note>
```bash
SMTP_ADDRESS=smtp.mandrillapp.com
SMTP_AUTHENTICATION=plain
SMTP_DOMAIN=<Your verified domain in Mailchimp>
SMTP_ENABLE_STARTTLS_AUTO=true
SMTP_PORT=587
SMTP_USERNAME=<Your SMTP username displayed under Settings -> SMTP & API info>
SMTP_PASSWORD=<Any valid API key, create an API key under Settings -> SMTP & API Info>
```
## Configure default language
```bash
DEFAULT_LOCALE='en'
```
## Configure storage
Chatwoot uses [active storage](https://edgeguides.rubyonrails.org/active_storage_overview.html) for storing attachments. The default storage option is the local storage on your server.
But you can change it to use any of the cloud providers like amazon s3, microsoft azure, google gcs etc. Refer [configuring cloud storage](/docs/self-hosted/deployment/storage/supported-providers) for additional environment variables required.
```bash
ACTIVE_STORAGE_SERVICE=local
```
When `local` storage is used the files are stored under `/storage` directory in the chatwoot root folder.
<Warning>
It is recommended to use a cloud provider for your chatwoot storage to ensure proper backup of the stored attachments and prevent data loss.
</Warning>
## Rails Logging Variables
By default, Chatwoot will capture `info` level logs in production. Ref [rails docs](https://guides.rubyonrails.org/debugging_rails_applications.html#log-levels) for the additional log-level options.
We will also retain 1 GB of your recent logs and your last shifted log file.
You can fine-tune these settings using the following environment variables
```bash
# possible values: 'debug', 'info', 'warn', 'error', 'fatal' and 'unknown'
LOG_LEVEL=
# value in megabytes
LOG_SIZE= 1024
```
## Configure FB Channel
To use FB Channel, you have to create a Facebook app in the developer portal. You can find more details about creating FB channels [here](https://developers.facebook.com/docs/apps/#register)
```bash
FB_VERIFY_TOKEN=
FB_APP_SECRET=
FB_APP_ID=
```
## Using CDN for asset delivery
With the release v1.8.0, we are enabling CDN support for Chatwoot. If you have a high traffic website, we recommend to setup a CDN for your asset delivery. Read setting up [CloudFront as your CDN](/docs/self-hosted/deployment/performance/cloudfront-cdn) guide.
## Enable new account signup
By default, Chatwoot will not allow users to create an account[multi-tenancy] from the login page. However, if you are setting up a public server, you can enable signup using:
```bash
ENABLE_ACCOUNT_SIGNUP=true
```
## Enable direct upload to storage cloud
By default, Chatwoot will upload the files to the application server and then it will push them to the cloud storage. We have introduced the direct upload functionality so that we can upload the file directly to the cloud storage. This has been built according to rails new direct upload functionality documented [here](https://edgeguides.rubyonrails.org/active_storage_overview.html#direct-uploads). Set below environment variable to true to use the direct upload feature.
Make sure to follow [this guide](https://edgeguides.rubyonrails.org/active_storage_overview.html#cross-origin-resource-sharing-cors-configuration) and set the appropriate CORS configuration on your cloud storage after setting `DIRECT_UPLOADS_ENABLED` to true.
```bash
DIRECT_UPLOADS_ENABLED=true
```
## Google OAuth
To enable Google OAuth in Chatwoot, you need to provide the client ID, client secret, and callback URL. You can find the instructions to generate the details [here](https://support.google.com/cloud/answer/6158849).
Set the `GOOGLE_OAUTH_CLIENT_ID` and `GOOGLE_OAUTH_CLIENT_SECRET` environment variables in your Chatwoot installation using the values you copied from the Google API Console. Set the `GOOGLE_OAUTH_CALLBACK_URL` environment variable to the callback URL you used in the Google API Console. Here's an example of the same
```bash
GOOGLE_OAUTH_CLIENT_ID=369777777777-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com
GOOGLE_OAUTH_CLIENT_SECRET=ABCDEF-GHijklmnoPqrstuvwX-yz1234567
GOOGLE_OAUTH_CALLBACK_URL=https://<your-server-domain>/omniauth/google_oauth2/callback
```
<Warning>
The callback URL should comply with the format in the example above. This endpoint cannot be changed at the moment.
</Warning>
After setting these environment variables, restart your Chatwoot server to apply the changes. Now, users will be able to sign in using their Google accounts.
## LogRocket
To enable LogRocket in Chatwoot, you need to provide the project ID from LogRocket. Here are the steps to follow:
1. Open the LogRocket [website](https://logrocket.com/) and create an account or sign in to your existing account.
2. After signing in, create a new project in LogRocket by clicking on "Create new project".
3. Enter a name for your project, and save the project ID.
4. Set the `LOG_ROCKET_PROJECT_ID` environment variable in your `.env` file with the project ID you copied from LogRocket.
```bash
LOG_ROCKET_PROJECT_ID=abcd12/pineapple-on-pizza
```
After setting this environment variable, restart your Chatwoot server to apply the changes. Now, LogRocket will start capturing user sessions on your Chatwoot installation.
@@ -0,0 +1,93 @@
---
title: Outlook & Microsoft 365 Email
description: Configure an OAuth app for Outlook & Microsoft 365 emails
sidebarTitle: Azure App Setup
---
Microsoft no longer permits the use of username and password to retrieve emails from Outlook & Microsoft 365 accounts. They have deprecated the basic auth option. To enable the Outlook/Microsoft 365 email channel in your self-hosted instance, you must configure an OAuth app.
This guide helps you set up an Entra ID App (formerly Azure Active Directory) and use the credentials in Chatwoot. By doing so, you can authenticate your Outlook/Microsoft 365 account as an email channel.
## Register the app
<Note>
For a more detailed guide on how to set up the Microsoft Identity platform, please refer to the [here](https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app).
</Note>
To access the Microsoft Entra Admin Center, go to [entra.microsoft.com](https://entra.microsoft.com/) and log in with your Microsoft account. Once logged in, navigate to the Identity section on the left-hand sidebar. In the Identity section, locate the "Applications" menu and click on "App Registrations" from the submenu. On the "App Registrations" page, click on the "New Registration" option. You will be able to see a page as shown below.
![register-an-app](/self-hosted/images/entra/register-an-app.png)
There are three options for supported account types. Ideally, you only need to select "Accounts in any organizational directory" as Chatwoot is generally used for business emails only. However, if you are connecting a personal account, select the second option. If you are using the applications outside your organization, you would need to register your account as a verified publisher.
To configure a redirect URI with the Web platform, use the following URL: `https://<your-instance-url>/microsoft/callback`. Click on register, and your app will be created. You will see a screen as shown below.
![registration-complete](/self-hosted/images/entra/registration-complete.png)
Save the Application (Client) ID. We will configure this as `AZURE_APP_ID` in Chatwoot later.
## Configure the application
To ensure proper functionality of Chatwoot, we need to configure the permissions and update the token configuration as follows.
### API permissions
Click on the "API Permissions" menu under the "Manage" section. By default, this will have [User.Read](http://user.read/) permission.
Click on the "Add permissions" button and add the following permissions from the Delegated permissions menu on Microsoft Graph APIs.
- **email**: To view the user's email address.
- **profile**: To view the name and picture etc.
- **offline_access**: To retrieve the emails even when you are not using the application.
- **SMTP.Send, Mail.Send:** Send emails using the SMTP AUTH when you reply to customers from the Chatwoot dashboard.
- **IMAP.AccessAsUser.All, Mail.ReadWrite:** Read and write access to mailboxes via IMAP.
- **openid:** Sign users in
![permissions](/self-hosted/images/entra/permissions.png)
### Token Configuration
Now, let's proceed to the Token Configuration to set up "optional claims". Optional claims are a feature in Entra ID that enables you to specify additional pieces of information (claims) to include in the security tokens issued to the application.
In Chatwoot, we use optional claims to minimize duplicate calls and retrieve some information in advance. Click on "Add optional claim" and add the following claims to the application.
![optional-claims.png](/self-hosted/images/entra/optional-claims.png)
### Configure Client Secret
Go to the Certificates & Secrets section to create a Client Secret. Click on the "New Client Secret" button and provide a description. You can also select an expiry time.
<Warning>
Remember that you will need to regenerate the secret and update it in the Chatwoot environment variables once it expires.
</Warning>
![add-client-secret](/self-hosted/images/entra/add-client-secret.png)
After clicking on the Add button, a client secret will be generated as shown below.
![client-secret-value](/self-hosted/images/entra/client-secret-value.png)
Save the value somewhere save as you cannot see it after refreshing the page. This would be used `AZURE_APP_SECRET` in Chatwoot.
## Configure environment variables in Chatwoot
After creating the Entra application, you need to configure the application credentials in Chatwoot. There are 2 variables that you need to configure, as shown in the steps above.
- **AZURE_APP_ID:** As seen in the register the app step, use the Application (Client) ID here.
- **AZURE_APP_SECRET:** Use the value obtained in the step configuring the client secret.
After updating the environment variables, restart the Chatwoot service for the changes to take effect. Now, verify if the channel is enabled in the Inbox creation flow. If everything is configured properly, you will see "Microsoft" listed as an email provider in the flow.
![microsoft-channel](/self-hosted/images/entra/microsoft-channel.png)
Voila! That's it you can now receive the emails in your Chatwoot instance.
## Thoughts on multi-tenancy and going for production
Note that the setup will not work for other emails under a different tenant until you have completed the Microsoft publisher verification process. During the authorization prompt, you will see "unverified" until the application is verified for production.
To test the changes before the app is verified for production, use the Entra ID app registration email address in the Chatwoot channel.
Publisher verification provides app users and organization admins with information about the authenticity of the developer's organization that publishes an app integrating with the Microsoft identity platform. If an app has a verified publisher, it means that Microsoft has verified the authenticity of the organization that publishes the app.
Read the publishing guidelines [here](https://learn.microsoft.com/en-us/entra/identity-platform/howto-convert-app-to-be-multi-tenant).
@@ -0,0 +1,83 @@
---
title: SendGrid Guide
description: Guide to setting up Conversation Continuity with SendGrid
sidebarTitle: SendGrid Guide
---
This doc will help you set up [Conversation continuity](https://www.chatwoot.com/docs/self-hosted/configuration/features/email-channel/conversation-continuity) with SendGrid.
## Installation
This example is based on a Heroku installation of Chatwoot, and using SendGrid for outgoing email. For more information about installing Chatwoot, go [here](https://www.chatwoot.com/docs/self-hosted#deployment).
## Configuring inbound reply emails
Firstly, we need to tell our Chatwoot instance what mailer we're using to handle incoming emails. We do that with a config var. Go to your Heroku dashboard, click on your Chatwoot instance and click settings.
![Screenshot_95](https://user-images.githubusercontent.com/34171640/128574548-7f2d6521-e79d-47bc-8f8d-6e8d7ca28ae1.png)
Then scroll until you see two blank fields with an add button. There, enter:
```javascript
RAILS_INBOUND_EMAIL_SERVICE=sendgrid
```
![Screenshot_96](https://user-images.githubusercontent.com/34171640/128575349-493efe35-86b9-48ea-84ff-cab7020fd832.jpg)
Next, we're going to set a password. We'll use this later on with SendGrid. For this example, we'll use something simple - like ```potatosalad```, but like all passwords - you should always use a secure mixture of letters, numbers and symbols.
![Screenshot_97](https://user-images.githubusercontent.com/34171640/128575151-9a3fe484-7f1d-43f9-968f-c9841c4d10d1.jpg)
## SendGrid
Now we're going to set up the domain we're using for inbound emails. Because you're most likely going to have an email service like Google Workspace or Microsoft 365 for Business, you should use a subdomain for your inbound emails to Chatwoot.
For example, let's say we used support.example.com as our domain. In this instance, we'd add an MX record pointing support.example.com to ```mx.sendgrid.net``` with a priority of ```10```.
You should wait a while (usually an hour will do). You can use [mxtoolbox.com](https://mxtoolbox.com) to check if the MX record has been propogated. If you see something like this, you can move onto the next step:
![Screenshot_98](https://user-images.githubusercontent.com/34171640/128576943-7f8267b5-d81a-4583-8a40-4941c7700d2b.png)
Now, go to the SendGrid dashboard at [app.sendgrid.com](https://app.sendgrid.com). Select Settings, and Inbound Parse.
![Screenshot_99](https://user-images.githubusercontent.com/34171640/128578295-f62fed61-3401-4a4b-a564-f61f282b8c07.png)
Then click "Add Host & URL".
![Screenshot_100](https://user-images.githubusercontent.com/34171640/128581269-2728e8d4-9c5f-4361-ba4f-3543a0f9a9d8.png)
**Receiving Subdomain** should be the domain you set up the MX record for earlier.
![Screenshot_101](https://user-images.githubusercontent.com/34171640/128581298-1271781f-6985-48b2-9ef9-e210ed5b6ecb.png)
Then add your **Destination URL**. Your Destination URL should look something like this:
```https://actionmailbox:potatosalad@chatwoot.example.com/rails/action_mailbox/sendgrid/inbound_emails```
``potatosalad`` is the password we set earlier, and ``chatwoot.example.com`` is the URL of our Chatwoot instance. Everything else should stay the same.
![Screenshot_102](https://user-images.githubusercontent.com/34171640/128581410-52834258-e826-4c2f-9868-a6c21c9a1ff9.png)
<Warning>
Make sure to check "POST the raw, full MIME message". In order to function correctly, Action Mailbox needs the raw MIME message.
</Warning>
![Screenshot_103](https://user-images.githubusercontent.com/34171640/128581457-ff5e385c-4d7e-4ebb-8f87-28fd5a243798.png)
## Setting the inbound domain variable in Heroku
Finally, we need to tell our Chatwoot installation what domain we're using with SendGrid.
Your variable should look like this:
```javascript
MAILER_INBOUND_EMAIL_DOMAIN=support.example.com
```
You should change ``support.example.com`` to the domain you used with SendGrid.
![Screenshot_104](https://user-images.githubusercontent.com/34171640/128582096-766a2835-04b9-47f0-8662-c602742e11f9.jpg)
## Next steps
You're done! Next, you should [enable the email channel](https://www.chatwoot.com/docs/self-hosted/configuration/features/email-channel/setup).
@@ -0,0 +1,124 @@
---
title: Conversation Continuity
description: Configure Conversation Continuity with Email
sidebarTitle: Conversation Continuity
---
## Conversation continuity
![101382999-9b0abf00-38de-11eb-845d-1bb1f52306df@2x](https://user-images.githubusercontent.com/73185/109548415-a1ca5c00-7af2-11eb-9b1d-fd636cf5189c.png)
## Configuring inbound reply emails
<Note>
Conversation Continuity requires your chatwoot installation to have a [cloud storage configured](/docs/self-hosted/deployment/storage/supported-providers)
</Note>
There are a couple of email infrastructure service providers to handle the incoming emails that we support at the moment. They are
Sendgrid, Mandrill, Mailgun, Exim, Postfix, Qmail and Postmark.
Step 1 : We have to set the inbound email service used as an environment variable.
```bash
# Set this to appropriate ingress service for which the options are :
# "relay" for Exim, Postfix, Qmail
# "mailgun" for Mailgun
# "mandrill" for Mandrill
# "postmark" for Postmark
# "sendgrid" for Sendgrid
RAILS_INBOUND_EMAIL_SERVICE=relay
```
If you wish to use the same local relaying server (for example postfix) to send outbound mail as you are using to relay inbound messages and you opt not to use an external authentication mechanism like SASL which may be the case if the server is handling it own emails only. The upstream SMTP platform Action Mailer attempts to use a default authentication method if the configuration options `SMTP_AUTHENTICATION`, `SMTP_USERNAME` and `SMTP_PASSWORD` are present in your .env file. To disable this behaviour either comment out or delete these lines from your configuration. This will allow you to send outbound messages from the same server without a premium service. Please note many ISP's do not allow email servers to be run from their networks. It is your responsibility to ensure adequate access control preventing yourself becoming an open relay and ensuring your server is able to get past your recipients spam filters for example SPF, DKIM & DMARC dns records.
This configures the ingress service for the app. Now we have to set the password for the ingress service that we use.
```bash
# Use one of the following based on the email ingress service
# Set this if you are using Sendgrid, Exim, Postfix, Qmail or Postmark
RAILS_INBOUND_EMAIL_PASSWORD=
# Set this if you are Mailgun
MAILGUN_INGRESS_SIGNING_KEY=
# Set this if you are Mandrill
MANDRILL_INGRESS_API_KEY=
```
### Mailgun
If you are using Mailgun as your email service, in the Mailgun dashboard configure it to forward your inbound emails to `https://example.com/rails/action_mailbox/mailgun/inbound_emails/mime` if `example.com` is where you have hosted the application.
#### Getting Mailgun Ingress Key
![mailgun-ingress-key](/self-hosted/images/mailgun-ingress-key.gif)
### Sendgrid
Ensure to set up the proper MX records for `your-domain.com` pointed towards Sendgrid
Configure SendGrid Inbound Parse to forward inbound emails to forward your inbound emails to `/rails/action_mailbox/sendgrid/inbound_emails` with the username `actionmailbox` and the password you previously generated. If the deployed application was hosted at `example.com`, you can configure the following URL as the forward route.
```bash
https://actionmailbox:PASSWORD@example.com/rails/action_mailbox/sendgrid/inbound_emails
```
When configuring your SendGrid Inbound Parse webhook, be sure to check the box labeled "Post the raw, full MIME message." Action Mailbox needs the raw MIME message to work.
### Mandrill
If you are configuring Mandrill as your email service, configure Mandrill to route your inbound emails to `https://example.com/rails/action_mailbox/mandrill/inbound_emails` if `example.com` is where you have hosted the application.
If you want to know more about configuring other services visit [Action Mailbox Basics](https://edgeguides.rubyonrails.org/action_mailbox_basics.html#configuration)
### IMAP via getmail
Chatwoot receives inbound emails through the [Action Mailbox](https://edgeguides.rubyonrails.org/action_mailbox_basics.html) feature of Ruby on Rails. Action Mailbox supports various 'ingresses' by default. They are defined in [here](https://github.com/rails/rails/blob/main/actionmailbox/lib/tasks/ingress.rake) and can be executed through `bin/rails`. For example
```bash
cat my_incoming_message | ./bin/rails action_mailbox:ingress:postfix \
RAILS_ENV=production \
URL=http://localhost:3000/rails/action_mailbox/postfix/inbound_emails \
INGRESS_PASSWORD=...
```
would import the contents of the file `my_incoming_message` into a Chatwoot instance running on `localhost` - assuming `my_incoming_message` contains an [RFC 822](https://datatracker.ietf.org/doc/html/rfc822) compliant message.
The ingress tasks provided by Action Mailbox are a thin layer around an HTTP endpoint exposed by Action Mailbox. An alternative to using those tasks is to talk to the http endpoint directly. The following script achieves the same.
```bash
INGRESS_PASSWORD=...
URL=http://localhost:3000/rails/action_mailbox/relay/inbound_emails
curl -sS -u "actionmailbox:$INGRESS_PASSWORD" \
-A "Action Mailbox curl relayer" \
-H "Content-Type: message/rfc822" \
--data-binary @- \
$URL
```
The popular mail retrieval system [getmail6](https://github.com/getmail6/getmail6) can be used to fetch mails and import them into Chatwoot. If the curl script above is stored in `/home/chatwoot/bin/import_mail_to_chatwoot`, a configuration for doing so from an IMAP inbox is as follows.
```
[retriever]
type = SimpleIMAPSSLRetriever
server = ...
username = ...
password = ...
[destination]
type = MDA_external
path = /home/chatwoot/bin/import_mail_to_chatwoot
[options]
verbose = 0
read_all = false
delete = false
delivered_to = false
received = false
message_log = /home/chatwoot/logs/import_imap.log
message_log_syslog = false
message_log_verbose = true
```
For mail to be imported you'll need to execute `getmail` regularly, for example using a cron job. For `IMAP` you can also run it constantly using `getmail --idle INBOX`, though that will need some care to deal with interrupted connections, etc.
## Configure inbound email domain environment variable
Add the following environment variable with the value `your-domain.com`, where `your-domain.com` is the domain for which you set up MX records in the previous step.
```bash
MAILER_INBOUND_EMAIL_DOMAIN=
```
After finishing the set up, the mail sent from Chatwoot will have a `replyto:` in the following format `reply+<random-hex>@<your-domain.com>` and reply to those would get appended to your conversation.
@@ -0,0 +1,38 @@
---
title: Email Channel Setup
description: Setting up Email Channel in Chatwoot
sidebarTitle: Email Channel Setup
---
## Configure Email Channel
<Note>
Email channels require [conversation continuity configured](/docs/self-hosted/configuration/features/email-channel/conversation-continuity)
</Note>
1. Enable `channel_email` (Login to rails console and execute the following)
```bash
account = Account.find(1)
account.enabled_features // This would list enabled features.
account.enable_features('channel_email')
account.save!
```
2. Now head over to inboxes page and create an email inbox with the support email as care@your-domain.com
![mail-channel-step1](/self-hosted/images/mail-channel-step1.png)
3. Now Add Agents who can have access to the email channel box.
4. Now you will get the email channel box address in the last step.
![mail-channel-step2](/self-hosted/images/mail-channel-step2.png)
5. Now create a forward rule in your care@your-domain.com inbox to forward emails to the address obtained at inbox creation step.
![set-forwarder-email](/self-hosted/images/set-forwarder-email.png)
6. You should be able to receive emails in your newly created email inbox in chatwoot.
![mail-channel-box](/self-hosted/images/mail-channel-box.png)
### Sendgrid
You can send out emails only from a verified email address in SendGrid. For sending emails from wildcard domain, do verification at domain level instead of individual email.
### Testing On Local
You can visit `http://localhost:3000/rails/conductor/action_mailbox/inbound_emails/new` to send inbound mails from local to chatwoot inbox.
@@ -0,0 +1,64 @@
---
title: Google Workspace
description: Configure an OAuth app for Gmail
sidebarTitle: Google Workspace
---
At present, Gmail integration operates through [less-secure](https://support.google.com/accounts/answer/6010255?hl=en) apps. However, as of June 15, 2024, Google Workspace will [cease to support](https://workspaceupdates.googleblog.com/2023/09/winding-down-google-sync-and-less-secure-apps-support.html) these less-secure apps. This will affect the Gmail integration in Chatwoot. To ensure that your Gmail integration continues to work, you will need to set up an OAuth app in Google Workspace.
<Note>
Existing setups will continue to work until September 30, 2024. However, we recommend setting up an OAuth app as soon as possible to avoid any disruptions.
</Note>
This guide will walk you through the process of setting up an OAuth app in Google Workspace.
## Register the app
To enable Google OAuth in Chatwoot, you need to provide the client ID, client secret, and callback URL. You can find the instructions to generate these details [here](https://support.google.com/cloud/answer/6158849). Once you have followed these steps, you will be able to get a Client ID and Secret.
![register-an-app](/self-hosted/images/google/oauth-app-setup.png)
Use the callback URL `https://<your-instance-url>/google/callback` when registering the app. This URL is used to redirect the user back to the Chatwoot instance after authentication.
Set the `GOOGLE_OAUTH_CLIENT_ID` and `GOOGLE_OAUTH_CLIENT_SECRET` environment variables in your Chatwoot installation using the values you copied from the Google API Console.
```bash
GOOGLE_OAUTH_CLIENT_ID=369777777777-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com
GOOGLE_OAUTH_CLIENT_SECRET=ABCDEF-GHijklmnoPqrstuvwX-yz1234567
```
<Note>
If you have already setup [Google OAuth login flow](https://www.chatwoot.com/docs/self-hosted/configuration/environment-variables#google-oauth) You can use the same app, by simply adding the new callback URL. **Do not remove the previous callback URL.**
</Note>
After setting these environment variables, restart your Chatwoot server to apply the changes. Now, users will be able to sign in using their Google accounts.
You will notice that the app you are using is in testing mode; we will cover that later in the guide. For now, you can ignore it.
## Configure the application
To fetch the emails from the client inbox, you need to configure the correct scopes. The following scopes are required:
- `https://mail.google.com/`: To read, send, delete, and manage your email.
- `email`: To view the user's email address.
- `profile`: To view the name and picture etc.
You can configure the scopes in the Google API Console by following the steps below:
1. Go to the [Google API Console](https://console.developers.google.com/).
2. Select the project you created earlier.
3. Click on the "OAuth consent screen" tab and click on the "Edit App" button.
4. Add the required scopes in the "Scopes for Google APIs" section.
5. Click on the "Save" button.
Here's a demo showing how to add the `https://mail.google.com/` scope:
![Demo add scope](/self-hosted/images/google/add-scope-demo.gif)
## Publishing the app
If you're using Chatwoot within an organization with fewer than 100 users, you can continue to use the app in testing mode. However, if you're using Chatwoot in an organization with more than 100 users or using the app to serve multiple clients, you will need to publish the app to make it available to all users.
To publish the app, you need to go through the verification process since we use a restricted scope. You can find the instructions to verify the app [here](https://support.google.com/cloud/answer/9110914).
It's important to note that the verification process can take a few days to complete. Once the app is verified, you can publish it and make it available to all users.
@@ -0,0 +1,52 @@
---
title: Help Center
description: Set up a public-facing help center portal with custom domain and SSL certificate
sidebarTitle: Help Center
---
Help center allows you to create a portal and add articles from the chatwoot app dashboard. You can point to these help center portal articles from your main site and display them as your public-facing help center.
## How to get SSL certificate for your custom domain
### Create a Portal in Chatwoot's dashboard
Follow these step to create your Portal. Refer to [this guide.](https://www.chatwoot.com/hc/user-guide/articles/1677861202-how-to-setup-a-help-center)
### Point your custom domain to your Chatwoot domain
1. Go to your DNS provider and add a new CNAME record.
- For the above example, add docs as a CNAME record and point it to the your selfhosted chatwoot domain(FRONTEND_URL).
2. This will ensure that your CNAME record points to the selfhosted Chatwoot installation. For your custom domain, we have your portal information. In this case, `docs.example.com`
### Setting up SSL
1. Use certbot to generate SSL certificates for your custom domain.
```bash
certbot certonly --agree-tos --nginx -d "docs.example.com"
```
2. Create a new nginx config to route requests to this domain to Chatwoot. Make a copy of `/etc/nginx/sites-available/nginx_chatwoot.conf` and make necessary changes for the new domain.
3. Restart nginx server.
```bash
sudo systemctl restart nginx
```
Voila!
`docs.yourdomain.com` is live with a secure connection, and your portal data is visible.
### How does this work?
These are the engineering details to understand `How does docs.yourdomain.com` gets the portal data with SSL certificate.
1. `docs.yourdomain.com` resolves by customers nameserver and redirects to your Chatwoot domain.
2. Chatwoot check for the portal record with custom-domain `docs.yourdomain.com`
3. Redirects to the portal records for the domain `docs.yourdomain.com`
Yaay!!
Now you can have your own help-center, product-documentation related portal saved at Chatwoot dashboard and served at your domain with SSL certificate.
@@ -0,0 +1,163 @@
---
title: Setting Up Facebook
description: Configure Facebook Messenger integration for Chatwoot
sidebarTitle: Facebook
---
To use Facebook Channel, you have to create a Facebook app in the developer portal. You can find more details about creating Facebook apps [here](https://developers.facebook.com/docs/apps/#register).
## Prerequisites
1. A valid facebook account.
2. A valid facebook page.
## Register A Facebook App
1. Go to [Facebook developer portal](https://developers.facebook.com/apps/) and click on the "Create App" button
![facebook_create_app](/self-hosted/images/facebook/facebook-create-app.png)
2. Select the option "Other".
![facebook_other_app](/self-hosted/images/facebook/facebook_other_app.png)
3. For the app type, choose "Business".
![facebook_business](/self-hosted/images/facebook/facebook_business.png)
3. Enter basic details like the app name and email.
![facebook_business_details](/self-hosted/images/facebook/facebook_business_details.png)
Once you register your Facebook App, you will have to obtain the `App Id` and `App Secret`. These values will be available in the app settings and will be required while setting up Chatwoot environment variables.
![facebook_app_id](/self-hosted/images/facebook/facebook_app_id.png)
## Configuring the Environment Variables in Chatwoot
Configure the following Chatwoot environment variables with the values you obtained during the Facebook app setup. The `FB_VERIFY_TOKEN` should be a unique and secure string that you provide when configuring the Facebook app. Generate a random string and set it as the `FB_VERIFY_TOKEN`. Facebook will include this string in all verification requests.
Restart the Chatwoot server after updating the environment variables
```bash
FB_VERIFY_TOKEN=
FB_APP_SECRET=
FB_APP_ID=
```
## Configure Facebook Login
1. Add the Facebook Login product via the Facebook app dashboard.
![facebook_app_login](/self-hosted/images/facebook/facebook_app_login.png)
2. Enable `Web OAuth Login`, `Login with Javascript SDK` and add your self-hosted domain to the `Allowed Domains for the JavaScript SDK` input.
![facebook_sdk_login](/self-hosted/images/facebook/facebook_sdk_login.png)
## Configure the Facebook App
1. In the app settings, add your `Chatwoot installation domain` as your app domain.
![facebook_app_domain](/self-hosted/images/facebook/facebook_app_domain.png)
2. In the products section in your app settings page, Add "Messenger"
![facebook_messenger_product](/self-hosted/images/facebook/facebook_messenger_product.png)
3. Go to the Messenger settings and configure the call back URL
![Alt text](/self-hosted/images/facebook/facebook_messenger_section.png)
4. Provide the Callback URL as `{your_chatwoot_installation_url}/bot` and the Verify token as `FB_VERIFY_TOKEN` from your environment variable.
![facebook_callback_url](/self-hosted/images/facebook/facebook_callback_url.png)
5. Head over to Chatwoot and create a Messenger inbox. Choose a page for which your Facebook developer account has admin access to. Please refer to this [guide](https://www.chatwoot.com/hc/user-guide/articles/1677778588-how-to-setup-a-facebook-channel) for more details on creating a Messenger inbox in Chatwoot.
## Testing the Facebook channel
Until the application is approved for production, Facebook wouldn't send the new messages on your page to Chatwoot.
To test the changes until the app is approved for production. Follow the steps
1. Head over to the messenger section in your app settings page, in Facebook developers.
![facebook_messenger_settings](/self-hosted/images/facebook/facebook_messenger_settings.png)
2. Click `Add or remove pages` and connect the page which you choose while creating the Chatwoot Messenger inbox.
![facebook_callback_pages](/self-hosted/images/facebook/facebook_callback_pages.png)
3. After connecting the pages, Click on `Add subscriptions` from the connected page.
![facebook_page_config](/self-hosted/images/facebook/facebook_page_config.png)
4. Subscribe to the following fields and save the subscription.
```
messages
messaging_postbacks
message_deliveries
message_reads
message_echoes
```
![facebook_page_subscription](/self-hosted/images/facebook/facebook_page_subscription.png)
4. Send a message to the connected page from your Facebook account and it should appear in Chatwoot now.
## Going into production.
Before you can start using your Facebook app in production, you will have to get it verified by Facebook. Refer to the [docs](https://developers.facebook.com/docs/apps/review/) on getting your app verified.
Obtain advanced access to the required permissions mentioned below for your Facebook app
```
pages_messaging
pages_show_list
pages_manage_metadata
business_management
pages_read_engagement
```
<Warning>
Make sure your facebook app subscription version is 17.0, we have updated the FB subscription with the latest version, so change the permission subscription version under the facebook app webhooks option.
</Warning>
## Developing or Testing Facebook Integration in your machine
Install [ngrok](https://ngrok.com/docs) on your machine. This will be required since Facebook Messenger API's will only communicate via https.
```bash
brew cask install ngrok
```
Configure ngrok to route to your Rails server port.
```bash
ngrok http 3000
```
Go to the Facebook developers page and navigate into your app settings. In the app settings, add `localhost` as your app domain.
In the Messenger settings page, configure the callback url with the following value.
```bash
{your_ngrok_url}/bot
```
Update verify token in your Chatwoot environment variables.
You will also have to add a Facebook page to your `Access Tokens` section in your Messenger settings page.
Restart the Chatwoot local server. Your Chatwoot setup will be ready to receive Facebook messages.
## Facebook API version
We support facebook API version v13.0 going forward, which you can update in the facebook app advanced settings.
![fb_api_version](/self-hosted/images/facebook/fb_api_version.png)
## Test your local Setup
1. After finishing the set-up above, [create a Facebook inbox](https://www.chatwoot.com/hc/user-guide/articles/1677778588-how-to-setup-a-facebook-channel) after logging in to your Chatwoot Installation.
2. Send a message to your page from Facebook.
3. Wait and confirm incoming requests to `/bot` endpoint in your ngrok screen.
@@ -0,0 +1,219 @@
---
title: Instagram via Facebook Login
description: Set up Instagram integration using Facebook Login authentication
sidebarTitle: Instagram via Facebook Login
---
<Note>
We recommend Instagram Business Login as the preferred authentication method, as it provides simpler configuration and a better developer experience. Please refer to this [guide](./instagram-via-instagram-business-login) for more details. We will be stopping the support for Instagram via Facebook Login in the future from v4.1 onwards.
</Note>
## Prerequisites
1. A valid facebook account.
2. A valid facebook page.
3. A valid instagram professional account.
## Register A Facebook App
To use Instagram Channel, you have to create a Facebook app in the developer portal. You can find more details about creating Facebook developer app [here](./facebook-channel-setup).
1. Click on the "Create App" button
![facebook_create_app](/self-hosted/images/facebook/facebook-create-app.png)
2. Select the option "Other".
![facebook_other_app](/self-hosted/images/facebook/facebook_other_app.png)
3. For the app type, choose "Business"
![facebook_business](/self-hosted/images/facebook/facebook_business.png)
3. Enter basic details like the app name and email.
![facebook_business_details](/self-hosted/images/facebook/facebook_business_details.png)
Once you register your Facebook App, you will have to obtain the `App Id` and `App Secret`. These values will be available in the app settings and will be required while setting up Chatwoot environment variables.
![facebook_app_id](/self-hosted/images/facebook/facebook_app_id.png)
## Configuring the Environment Variables in Chatwoot
Configure the following Chatwoot environment variables with the values you obtained during the Facebook app setup. The `IG_VERIFY_TOKEN` should be a unique and secure string that you provide when configuring the Instagram app.
Restart the Chatwoot server after updating the environment variables
```bash
IG_VERIFY_TOKEN=
FB_APP_SECRET=
FB_APP_ID=
```
## Configure the Facebook App
1. In the app settings, add your "Chatwoot installation domain" as your app domain.
![facebook_app_domain](/self-hosted/images/facebook/facebook_app_domain.png)
2. Add the "Instagram Graph API" product via the Facebook app dashboard.
![instagram_product](/self-hosted/images/instagram/instagram_product.png)
3. Go to the app settings and select "Webhooks". From there, choose Instagram and click on the "Subscribe to this object" button.
![instagram_webhooks](/self-hosted/images/instagram/instagram_webhooks.png)
4. Provide the Callback URL as `{your_Chatwoot_installation_url}/webhooks/instagram` and the Verify token as `IG_VERIFY_TOKEN` from your environment variable.
![instagram_webhook_url](/self-hosted/images/instagram/instagram_webhook_url.png)
## Connect the facebook page with instagram account
1. Go to [Facebook pages](https://www.facebook.com/pages/?category=your_pages) and select your page and open the settings
![facebook_page_settings](/self-hosted/images/instagram/facebook_page_settings.png)
2. Go to "Linked accounts" and connect your instagram professional account.
![facebook_connect_instagram](/self-hosted/images/instagram/facebook_connect_instagram.png)
3. Select the option "Business"
![instagram_connect_facebook](/self-hosted/images/instagram/instagram_connect_facebook.png)
4. Select the instgram account category
![select_category_instagram](/self-hosted/images/instagram/select_category_instagram.png)
5. If everything is okay, you will see the message "Instagram connected."
![instagram_connect_success](/self-hosted/images/instagram/instagram_connect_success.png)
## Create Instagram Inbox in Chatwoot
1. Head over to Chatwoot and create a Messenger inbox. Please refer to this [guide](https://www.chatwoot.com/hc/user-guide/articles/1677829420-how-to-setup-an-instagram-channel) for more details on creating a Messenger inbox in Chatwoot.
So whenever you receive any message on Instagram, it will redirect to your Facebook page.
## Testing the Instagram channel
Until the application is approved for production, Facebook wouldn't send the new messages on your instagram to Chatwoot.
To test the changes until the app is approved for production. Follow the steps
1. Create a Test app for your app.
![facebook_instagram_test](/self-hosted/images/instagram/facebook_instagram_test.png)
2. Add the `Instagram Graph API` product via the Facebook app dashboard.
![instagram_product](/self-hosted/images/instagram/instagram_product.png)
3. Go to the app settings and select "Webhooks". From there, choose Instagram and click on the "Subscribe to this object" button.
![instagram_webhooks](/self-hosted/images/instagram/instagram_webhooks.png)
4. Provide the Callback URL as `{your_chatwoot_installation_url}/webhooks/instagram` and the Verify token as `IG_VERIFY_TOKEN` from your environment variable.
![instagram_webhook_url](/self-hosted/images/instagram/instagram_webhook_url.png)
5. Open the test app and add extra product for the test app: Instagram Basic Display
![instagram_basic_display](/self-hosted/images/instagram/instagram_basic_display.png)
6. In the app settings, add the platform "Website" and give `Site URL` as your installation URL.
![instagram_app_platform](/self-hosted/images/instagram/instagram_app_platform.png)
7. Head over to the Instagram Basic Display section and create a new app.
![instagram_basic_display_settings](/self-hosted/images/instagram/instagram_basic_display_settings.png)
8. Add Instagram Testers by clicking "Add or Remove Instagram Testers" button.
![instagram_testers](/self-hosted/images/instagram/instagram_testers.png)
9. Make sure that you have selected the role `Instagram Tester` while creating a new tester.
![instagram_tester_list](/self-hosted/images/instagram/instagram_tester_list.png)
10. Click on Edit subscriptions under Webhook > Instagram and subscribe to the following,
```
message_reactions
messages
messaging_seen
```
![instagram_subscription](/self-hosted/images/instagram/instagram_subscription.png)
<Note>
You should do this step for both normal and test apps.
</Note>
1. Head over to Chatwoot and create a Messenger inbox. Please refer to this [guide](https://www.chatwoot.com/hc/user-guide/articles/1677829420-how-to-setup-an-instagram-channel) for more details on creating a Messenger inbox in Chatwoot.
2. Send a message to the connected Instagram account from Instagram Testers, and it should appear in Chatwoot now
## Going into production.
Before you can start using your Facebook app in production, you will have to get it verified by Facebook. Refer to the [docs](https://developers.facebook.com/docs/messenger-platform/instagram/app-review) on getting your app verified.
Obtain advanced access to the required permissions mentioned below for your Facebook app
```
instagram_manage_messages
instagram_basic
pages_show_list
pages_manage_metadata
pages_messaging
business_management
```
<Note>
If your facebook app's version is more than 7.0 then you will need extra permission according to facebook's updated policy. Make sure you get permission for.
```
pages_read_engagement
```
</Note>
## Developing or Testing Facebook Integration in your machine
Install [ngrok](https://ngrok.com/docs) on your machine. This will be required since Facebook Messenger APIs will only communicate via https.
```bash
brew cask install ngrok
```
Configure ngrok to route to your Rails server port.
```bash
ngrok http 3000
```
Go to the Facebook developers page and navigate into your app settings. Add `localhost` as your app domain and add a privacy policy URL in the app settings.
In the Webhook > Instagram settings shown in the above image, configure the callback url with the following value.
```bash
{your_ngrok_url}/webhooks/instagram
```
Update verify token in your Chatwoot environment variables.
You will also have to add a Facebook page to your `Access Tokens` section in your Messenger settings page.
Restart the Chatwoot local server. Then, your Chatwoot setup will be ready to receive Facebook messages.
## Test your local Setup
1. After finishing the setup above, [create a Messenger inbox](https://www.chatwoot.com/hc/user-guide/articles/1677778588-how-to-setup-a-facebook-channel) after logging in to your Chatwoot Installation.
2. Send a message to your Facebook Page from your Instagram account.
3. Wait and confirm incoming requests to `/webhooks/instagram` endpoint in your ngrok screen.
4. You can also verify your callback URL by clicking on Test for the subscribed Instagram fields.
Go to webhook Instagram and click on Test with `v11.0`
![subscribe](/self-hosted/images/instagram/subscribe.png)
<Note>
You can have only one app connected to the Chatwoot for Instagram and Facebook combined as the Messenger platform is common. But suppose you want to have separate channels for Instagram and Facebook. In that case, you can have multiple Facebook pages inside your app that would be connected to Facebook users and Instagram users separately and then connected to the different inbox in the Chatwoot page.
</Note>
## Checklist
1. Integrate the Facebook test app and Send a message from the Instagram tester to the connected account.
2. Make sure your Instagram account is a business account.
3. If the Instagram test account can receive the message and forward it to the webhook URL, then submit it for review.
4. If the Instagram test account is not able to receive the message and forward it to the webhook URL
- Check the logs if you are receiving the message to `{your-app-url}/webhooks/Instagram`
- If the logs are present for the above endpoint, if there are any errors, then reach out to us. We will help you out.
- If the logs aren't present for the above endpoint, then raise a bug for the Facebook team or follow this bug https://developers.facebook.com/support/bugs/468852858104743/
5. If you are not facing the above issue and can get the message, but the review isn't passing, then reach out to the reviewer.
- When your app gets rejected, open the rejected submission. You can see the messenger icon in the bottom right corner to support you with your rejected review.
- You can talk to the support team and ask your questions about the submission and the reason for the rejection.
6. If your test app passed the review, it's good to go into production.
7. If you face an issue on production that you cannot receive the messages, then reach out to us with the error logs.
@@ -0,0 +1,110 @@
---
title: Instagram via Instagram Business Login
description: Set up Instagram integration using Instagram Business Login authentication (recommended method)
sidebarTitle: Instagram via Instagram Business Login
---
<Note>
Please ensure you have installed version v4.1 or above. If not, please refer to this [guide](./instagram-channel-setup) for the Facebook Login method.
</Note>
## Prerequisites
1. A valid facebook account.
2. A valid instagram professional account.
## Register A Facebook App
To use Instagram Channel, you have to create a Facebook app in the developer portal. You can find more details about creating Facebook apps [here](./facebook-channel-setup).
1. Click on the "Create App" button
![facebook_create_app](/self-hosted/images/facebook/facebook-create-app.png)
2. Select the option "Other".
![facebook_other_app](/self-hosted/images/facebook/facebook_other_app.png)
3. For the app type, choose "Business"
![facebook_business](/self-hosted/images/facebook/facebook_business.png)
4. Add app name and connect business account
![facebook_business_details](/self-hosted/images/facebook/facebook_business_details.png)
5. Add Instagram product from the Home page.
![instagram_product](/self-hosted/images/instagram/instagram_product.png)
## Configure Instagram settings for Chatwoot
1. Copy Instagram app ID and Instagram app secret
![instagram_app_id](/self-hosted/images/instagram/instagram_app_id.png)
2. Add the Instagram app ID and Instagram app secret to your app config via `{Chatwoot installation url}/super_admin/app_config?config=instagram`
![instagram_app_config](/self-hosted/images/instagram/instagram_app_config.png)
3. Configure Webhooks
Set the callback URL to `{your_chatwoot_url}/webhooks/instagram`. The verify token should match your `INSTAGRAM_VERIFY_TOKEN`, which can be configured through `app_config`
![instagram_webhooks](/self-hosted/images/instagram/instagram_webhook.png)
Subscribe to `messages`, `messaging_seen`, and `message_reactions` events.
![instagram_webhooks_subscribe](/self-hosted/images/instagram/instagram_webhooks_subscribe.png)
<Note>
To receive web hooks, app mode should be set to "Live".
</Note>
4. Set up Instagram business login
Set Redirect URL as `{your_chatwoot_url}/instagram/callback`
![instagram_business_login](/self-hosted/images/instagram/instagram_business_login.png)
5. Create a new Instagram tester account
## Create Instagram Inbox
Head over to Chatwoot and create a Instagram inbox. Please refer to this [guide](https://chatwoot.help/hc/user-guide/articles/1744361165-how-to-setup-an-instagram-channel-via-instagram-login) for more details on creating a Instagram inbox in Chatwoot.
## How to test the Instagram before going to live
1. Add Instagram Testers by clicking "Add People" button.
![facebook_instagram_test](/self-hosted/images/instagram/instagram-testers-list.png)
2. Make sure that you have selected the role Instagram Tester while creating a new tester.
![instagram_tester_list](/self-hosted/images/instagram/instagram-add-tester.png)
## Going into production.
Before you can start using your Facebook app in production, you will have to get it verified by Facebook. Refer to the [docs](https://developers.facebook.com/docs/messenger-platform/instagram/app-review) on getting your app verified.
## Troubleshooting & Common Errors
### Insufficient Developer Role Error
Ensure the Instagram user is added as a developer: `Meta Dashboard → App Roles → Roles → Add People → Enter Instagram ID`
### API Access Deactivated
Ensure the **Privacy Policy URL** is valid and correctly set.
### Invalid request: Request parameters are invalid: Invalid redirect_uri
Please configure the Frontend URL. The Frontend URL does not match the authorization URL.
### Instagram Channel creation Error: Failed to exchange token
Please make sure that tester account has been added to the facebook app settings.
### 400: Session Invalid when connecting the instagram channel
This might be issue from facebook side. Please try again after some time.
@@ -0,0 +1,43 @@
---
title: Setting Up Linear Integration
description: Configure Linear integration to track issues and features from Chatwoot
sidebarTitle: Linear
---
Setting up Chatwoot Linear integration involves 5 steps.
1. Create a Linear app in the [developer portal](https://linear.app/settings/api/applications/new).
2. Add necessary details and save the app.
3. Configure Chatwoot with the `Client ID` and `Signing Secret` obtained from the Linear app.
4. Open Chatwoot UI, navigate to integrations, select Linear, and click connect.
5. Voila! You should now be able to use Linear in your Chatwoot account.
## Register and configure the Linear app
To use Linear Integration, you need to create a Linear app in the developer portal. You can find more details about creating Linear apps at the [Linear developer portal](https://developers.linear.app/docs/oauth/authentication).
1. Create a Linear app.
2. Obtain the `Client ID` and `Client Secret` for the app and configure it in your app config via `{Chatwoot installation url}/super_admin/app_config?config=linear`
3. The callback URL should be `{Chatwoot installation url}/linear/callback`.
4. Toggle the `Public` switch to make the app public.
![linear_app_domain](/self-hosted/images/linear/create-app.png)
## Configure Linear app config
Obtain the `Client ID` and `Client Secret` for the app and configure it in your app config via `{Chatwoot installation url}/super_admin/app_config?config=linear`. These values will be available when you create the app in the developer portal.
```bash
LINEAR_CLIENT_ID=
LINEAR_SIGNING_SECRET=
```
Restart the Chatwoot server.
<Note>
Linear will only show up in the integrations section once you have configured these values and restarted the server.
</Note>
## Connect Chatwoot with your Linear account
Follow this [guide](https://chatwoot.help/hc/user-guide/articles/1739949089-how-to-track-issues-and-features-with-linear-integration) to complete the Linear integration.
@@ -0,0 +1,37 @@
---
title: Setting Up Shopify Integration
description: Configure Shopify integration to track orders and customer information from Chatwoot
sidebarTitle: Shopify
---
Setting up Chatwoot Shopify integration involves 5 steps.
1. Create a Shopify app in the [shopify partner dashboard](https://partners.shopify.com/).
2. Add necessary details and save the app.
3. Configure Chatwoot with the `Client ID` and `Client secret` obtained from the Shopify app.
4. Open Chatwoot UI, navigate to integrations, select Shopify, and click connect.
5. Voila! You should now be able to use Shopify in your Chatwoot account.
## Register and configure the Shopify app
To use Shopify Integration, you need to create a Shopify app in the [shopify partner dashboard](https://partners.shopify.com/). You can find more details about creating Shopify apps at the [Shopify developer portal](https://shopify.dev/docs/apps/build).
1. Create a Shopify app.
![shopify_app_create](/self-hosted/images/shopify/create-app.png)
2. Obtain the `Client ID` and `Client Secret` for the app and configure it in your app config via `{Chatwoot installation url}/super_admin/app_config?config=shopify`
![shopify_app_domain](/self-hosted/images/shopify/configure-app.png)
3. Configure the redirect URL as `{Chatwoot installation url}/shopify/callback` in app configuration.
![shopify_app_redirect](/self-hosted/images/shopify/callback.png)
<Note>
Shopify will only show up in the integrations section once you have configured these values.
</Note>
## Connect Chatwoot with your Shopify account
Follow this [guide](https://chatwoot.help/hc/user-guide/articles/1742395545-how-to-track-orders-with-shopify-integration) to complete the Shopify integration.
@@ -0,0 +1,79 @@
---
title: Setting Up Slack Integration
description: Configure Slack integration to receive Chatwoot conversations in Slack channels
sidebarTitle: Slack
---
Setting up Chatwoot Slack integration involves 5 steps.
1. Create a slack app in the developer portal.
2. Add necessary permissions for the slack app.
3. Configure Chatwoot with the `client ID` and `client Secret` obtained from the slack app.
4. Open Chatwoot UI, navigate to integrations, Slack and click connect.
5. Voila! You should be receiving new conversations in the #customer-conversations channel in Slack.
## Register a Slack app
To use Slack Integration, you have to create a Slack app in the developer portal. You can find more details about creating Slack apps at the [Slack developer portal](https://api.slack.com/).
Once you register your Slack App, you will have to obtain the `Client Id` and `Client Secret`. These values will be available in the app settings and will be required while setting up Chatwoot environment variables.
## Configure the Slack app
1. Create a Slack app and add it to your development workspace.
2. Obtain the `Client Id` and `Client Secret` for the app and configure it in your Chatwoot [environment variables](/docs/self-hosted/configuration/environment-variables).
3. Head over to the `OAuth & permissions` section under `features` tab.
4. In the redirect URLs, Add your Chatwoot installation base URL.
5. In the scopes section configure the given scopes for bot token scopes:
- `channels:history`
- `channels:join`
- `channels:manage`
- `channels:read`
- `chat:write`
- `chat:write.customize`
- `commands`
- `files:read`
- `files:write`
- `groups:history`
- `groups:write`
- `im:history`
- `im:write`
- `links:read`
- `links:write`
- `mpim:history`
- `mpim:write`
- `users:read`
- `users:read.email`
7. In the user access token section subscribe to: `files:read`, `files:write`, `remote_files:share`
8. Head over to the `Events Subscriptions` section in the `Features` tab.
9. Enable events and configure the given request url `{Chatwoot installation url}/api/v1/integrations/webhooks`
10. Subscribe to the following bot events: `link_shared`, `message.channels`, `message.groups`, `message.im`, `message.mpim`.
11. Add the installation URL as `domain` under the `App unfurl domains section` to display meta information about the conversation when the conversation URL is shared.
12. Connect Slack integration on Chatwoot app and get productive.
## Configure the environment variables in Chatwoot
Obtain the `Client ID` and `Client Secret` for the app and configure it in your Chatwoot [environment variables](/docs/self-hosted/configuration/environment-variables).These values will be available under `Settings` > `Basic Information`.
```bash
SLACK_CLIENT_ID=
SLACK_CLIENT_SECRET=
```
Restart the Chatwoot server.
<Note>
Slack will only show up in the integrations section once you have configured these values and restarted the server.
</Note>
## Connect Chatwoot with your Slack workspace
Follow this [guide](https://www.chatwoot.com/hc/user-guide/articles/1677774874-how-to-answer-conversations-from-slack) to complete the Slack integration.
## Testing your setup
1. Create a new conversation.
2. Ensure that you are receiving the Chatwoot messages in the connected slack channel.
3. Add a message to that thread and ensure that it is coming back on to Chatwoot.
4. Add `note:` or `private:` in front of the Slack message to see if it is coming out as private notes.
5. If your Slack member's email matches their email on Chatwoot, the messages will be associated with their Chatwoot user account.
@@ -0,0 +1,54 @@
---
title: APM and Tracing
description: Configure APM and error monitoring tools for Chatwoot
sidebarTitle: APM and Tracing
---
Chatwoot supports various APM and monitoring tools.
You can enable them by configuring the given environment variables.
## [Sentry](https://sentry.io/)
Provide your `sentry dsn`.
```bash
SENTRY_DSN=
```
## [Scout](https://scoutapm.com)
Provide values for the following environment variables. Refer [scout documentation](https://scoutapm.com/docs/ruby/configuration) for additional options.
```bash
## https://scoutapm.com/docs/ruby/configuration
# SCOUT_KEY=YOURKEY
# SCOUT_NAME=YOURAPPNAME (Production)
# SCOUT_MONITOR=true
```
## [NewRelic](https://newrelic.com/)
Enable Newrelic by configuring the license key. Refer [newrelic documentation](https://docs.newrelic.com/docs/agents/ruby-agent/configuration/ruby-agent-configuration/) for additional options.
```bash
# https://docs.newrelic.com/docs/agents/ruby-agent/configuration/ruby-agent-configuration/
# NEW_RELIC_LICENSE_KEY=
```
## [DataDog](https://www.datadoghq.com/)
Datadog requires an agent running on the host machine to which the tracing library can send data. Chatwoot ruby code contains the tracing library, but you need to configure the agent in your host machine/docker environment for the integration to work.
Enable Datadog in chatwoot by configuring the `trace agent url`.
```bash
## https://github.com/DataDog/dd-trace-rb/blob/master/docs/GettingStarted.md#environment-variables
# DD_TRACE_AGENT_URL=http://localhost:8126
```
### Running Datadog agent in local via docker
```bash
# to run in your local machine binding to port 8126
# replace <dd API key> and dd_site as required
docker run -d --name dd-agent -v /var/run/docker.sock:/var/run/docker.sock:ro -v /proc/:/host/proc/:ro -v /sys/fs/cgroup/:/host/sys/fs/cgroup:ro -p 8126:8126 -e DD_API_KEY=<dd api key> -e DD_SITE="datadoghq.com" gcr.io/datadoghq/agent:7
```
Refer Datadog documentation to install the agent in specific environments like [Ubuntu](https://docs.datadoghq.com/agent/basic_agent_usage/ubuntu/?tab=agentv6v7), [Docker](https://docs.datadoghq.com/agent/docker/?tab=standard), [kubernetes](https://docs.datadoghq.com/agent/kubernetes/?tab=helm) etc.
@@ -0,0 +1,38 @@
---
title: Rate Limiting
description: Configure rate limiting to protect your Chatwoot installation from abuse
sidebarTitle: Rate Limiting
---
To protect the system from abusive requests, Chatwoot makes use of [`rack_attack`](https://github.com/rack/rack-attack) gem.
You could customize the configuration to suit your needs by updating, [`config/initializers/rack_attack.rb`](https://github.com/chatwoot/chatwoot/blob/develop/config/initializers/rack_attack.rb)
## Default Rate Limits
- Chatwoot will throttles requests by IP at `60rpm`, Unless the request is from an allowed IP `['127.0.0.1', '::1']`
- Signup Requests are limited by IP at `5 requests` per `5 minutes`.
- SignIn Requests are limited by IP at `5 requests` per `20 seconds`.
- SignIn Requests are limited by email address at `20 requests` per `5 minutes` for a specific email.
- Reset Password Requests are limited at `5 requests` per `1 hour` for a specific email.
## Attachment Restrictions
- `Contact/Inbox Avatar` attachment file types are limited to jpeg, gif and png.
- `Contact/Inbox Avatar` attachment file size is limited to 15MB.
- `Website Channel` message attachments are limited to types ['image/png', 'image/jpeg', 'image/gif', 'image/bmp', 'image/tiff', 'application/pdf', 'audio/mpeg', 'video/mp4', 'audio/ogg', 'text/csv']
- `Website Channel` message attachments are limited to 40MB size limit.
## Disabling Rack attack on your instance
You can control the behaviour of rack attack in your instance via the following environment variables.
```bash
## Rack Attack configuration
## To prevent and throttle abusive requests.
# Disable if you are getting too many request errors for custom use cases
# ENABLE_RACK_ATTACK=true
# Control the allowed number of requests
# RACK_ATTACK_LIMIT=300
# Control whether you want to enable rack attack for widget APIs
# ENABLE_RACK_ATTACK_WIDGET_API=true
```
@@ -0,0 +1,41 @@
---
title: Super Admin Console
description: Guide to accessing and using the Super Admin Console and Sidekiq monitoring
sidebarTitle: Super Admin Console
---
You will need a user account with super admin privileges to access the super admin console and Sidekiq console.
<Note>
The first user created during onboarding is a `super admin`.
</Note>
## Access superadmin console
- Access `<chatwoot-installation-url>/super_admin`.
## Creating new super admins
- Use the super admin console and navigate to the user's section
- Click on the new user button, fill in the details, and select the type to be `super admin`
## Access Sidekiq via the super admin console
- Access `<chatwoot-installation-url>/super_admin`.
- Authenticate using the admin credentials created during the installation.
- You can access the Sidekiq option on the sidebar.
## Access Rails console
Run the following command in your console from the root folder of your Chatwoot Rails app.
```bash
RAILS_ENV=production bundle exec rails c
```
If you have `cwctl`, use `cwctl --console`.
- If you running Chatwoot in a Docker container, you would need to access the shell inside your container first.
- If you are running Chatwoot on Caprover, use the following command to access the command line.
```bash
docker exec -it $(docker ps --filter name=srv-captain--chatwoot-web -q) /bin/sh
```
@@ -0,0 +1,99 @@
---
title: Cloudfront CDN
description: Configure Cloudfront as a CDN for Chatwoot assets
sidebarTitle: Cloudfront CDN
---
This document helps you to configure Cloudfront as the asset host for Chatwoot. If you have a high traffic website, we would recommend setting up a CDN for Chatwoot.
## Configure a Cloudfront distribution
**Step 1**: Create a Cloudfront distribution.
![create-distribution](/self-hosted/images/cloudfront/create-distribution.png)
**Step 2**: Select "Web" as delivery method for your content.
![web-delivery-method](/self-hosted/images/cloudfront/web-delivery-method.png)
**Step 3**: Configure the Origin Settings as the following.
![origin-settings](/self-hosted/images/cloudfront/origin-settings.png)
- Provide your Chatwoot Installation URL under Origin Domain Name.
- Select "Origin Protocol Policy" as Match Viewer.
**Step 4**: Configure Cache behaviour.
![cache-behaviour](/self-hosted/images/cloudfront/cache-behaviour.png)
- Configure **Allowed HTTP methods** to use *GET, HEAD, OPTIONS*.
- Configure **Cache and origin request settings** to use *Use legacy cache settings*.
- Select **Whitelist** for *Cache Based on Selected Request Headers*.
- Add the following headers to the **Whitelist Headers**.
![extra-headers](/self-hosted/images/cloudfront/extra-headers.png)
- **Access-Control-Request-Headers**
- **Access-Control-Request-Method**
- **Origin**
- Set the **Response headers policy** to **CORS-With-Preflight**
**Step 5**: Click on **Create Distribution**. You will be able to see the distribution as shown below. Use the **Domain name** listed in the details as the **ASSET_CDN_HOST** in Chatwoot.
![cdn-distribution-settings](/self-hosted/images/cloudfront/cdn-distribution-settings.png)
## Add ASSET_CDN_HOST in Chatwoot
Your Cloudfront URL will be of the format `<distribution>.cloudfront.net`.
Set
```bash
ASSET_CDN_HOST=<distribution>.cloudfront.net
```
in the environment variables.
## Benefits of Using CDN
<Tip>
Using a CDN provides several benefits for your Chatwoot installation:
</Tip>
1. **Faster Asset Loading**: Assets are served from edge locations closer to users
2. **Reduced Server Load**: Static assets are served from CDN, reducing load on your application server
3. **Better User Experience**: Faster page load times improve user experience
4. **Global Availability**: Assets are cached globally for users worldwide
5. **Bandwidth Savings**: Reduces bandwidth usage on your origin server
## Troubleshooting
### CORS Issues
If you encounter CORS issues after setting up CloudFront:
1. Ensure the CORS headers are properly configured in CloudFront
2. Verify that your `CORS_ORIGINS` environment variable includes your CDN domain:
```bash
CORS_ORIGINS=https://yourdomain.com,https://d1234567890.cloudfront.net
```
### Cache Invalidation
To invalidate CloudFront cache after updating assets:
1. Go to CloudFront console
2. Select your distribution
3. Create an invalidation for `/*` to clear all cached assets
### SSL Certificate
For custom domain names with CloudFront:
1. Request an SSL certificate in AWS Certificate Manager (ACM)
2. Configure the certificate in your CloudFront distribution
3. Update your DNS to point to the CloudFront distribution
<Note>
SSL certificates for CloudFront must be requested in the US East (N. Virginia) region regardless of where your distribution is located.
</Note>
@@ -0,0 +1,108 @@
---
title: Optimizing Configurations
description: Performance optimization guide for Chatwoot self-hosted deployments
sidebarTitle: Optimizing Configurations
---
This document helps you to fine-tune various configuration values available in Chatwoot to extract the maximum performance out of your Chatwoot Installation.
## Puma
Chatwoot uses [Puma](https://puma.io/) as its Webserver. So let's start with a brief introduction to Puma workers and threads.
Puma is a popular web server for Ruby on Rails applications, and it uses multiple workers and threads to handle incoming requests. Each Worker runs its own instance of the application, and each thread within a worker can handle a single request at a time.
Now, let's move on to how you can configure Puma workers and threads using environment variables.
### Workers
Each Puma worker is a separate process that runs an instance of the Ruby application. Each Worker has its own event loop that can handle incoming requests concurrently using multiple threads.
When the Puma server receives a request, it is assigned to a worker process in a round-robin fashion. Once a worker receives a request, it assigns the request to an available thread within its process. Each thread then handles the request, including any required database queries, calculations, and other processing tasks. Using multiple worker processes allows Puma to handle multiple requests concurrently without blocking other requests or causing a bottleneck.
#### Configuring the number of workers
The `WEB_CONCURRENCY` environment variable can be used to configure the number of workers in Puma. It's important to consider the number of available CPU cores and aim for a ratio of workers to cores that allows the server to run at maximum capacity without causing performance issues. It's recommended to have a number of workers that matches or is slightly less than the number of available CPU cores to avoid competition for CPU time, which can lead to performance issues.
```
WEB_CONCURRENCY=2
```
<Note>
The default configuration in Chatwoot for `WEB_CONCURRENCY` is `0`. I.e. it runs one Worker. This is to ensure the application works on machines with a lower configuration. If you run Chatwoot on machines with higher specs, fine-tune this configuration accordingly.
</Note>
### Threads
Each Puma thread is a lightweight execution context that can handle a single request at a time. When a worker process receives a request, it is assigned to an available thread within that process. Each thread then handles the request, including any required database queries, calculations, and other processing tasks.
Using multiple threads can increase concurrency and performance, but balancing the number of threads with the available CPU resources is essential to avoid competition for CPU time. The number of threads can be configured using the following environment variables.
```
# Only required to configure if absolutely necessary
# Defaults to Max threads value by default
# RAILS_MIN_THREADS=5
RAILS_MAX_THREADS=5
```
<Note>
The default configuration in Chatwoot for `RAILS_MAX_THREADS` values is `5`. You can fine-tune it based on your requirements. The value of `RAILS_MIN_THREADS` defaults to `RAILS_MAX_THREADS` unless a specific value is provided.
</Note>
### Fine-tuning
TLDR: You can configure `WEB_CONCURRENCY` to the number of CPU cores and then fine-tune the number of `RAILS_MAX_THREADS` based on the available `memory` and `CPU` resources. While running the sidekiq and rails server on a single machine, consider the sidekiq configuration while determining these numbers.
References:
- https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server
- https://www.speedshop.co/2017/10/12/appserver.html
- https://github.com/ankane/the-ultimate-guide-to-ruby-timeouts#puma
## Sidekiq
Sidekiq is a popular job processing library for Ruby on Rails applications. Chatwoot uses it as a simple and efficient way to execute background jobs asynchronously in the Rails application.
Sidekiq uses Redis to manage a job queue, allowing you to run multiple workers in parallel, each processing jobs from the queue. This makes it easy to distribute workloads and handle large volumes of jobs without bogging down your Rails application's main thread.
You can configure the number of sidekiq workers using the following environment variables.
```
# the default value in Chatwoot is 10
SIDEKIQ_CONCURRENCY=10
```
<Note>
If you are running sidekiq on dedicated pods, you can fine-tune the `SIDEKIQ_CONCURRENCY` number to extract the maximum performance of the available CPU resources.
</Note>
## Database Connections
When a Ruby on Rails application is launched, it creates a pool of database connections that are stored in memory. These connections are established with the database server at the beginning of the application and are kept open throughout the life of the application. When a request is made to the application that requires access to the database, the application server will retrieve a connection from the pool and use it to process the request. Once the request is complete, the connection is returned to the pool to be used for future requests.
The size of the database pool in Chatwoot is configured automatically based on the values of `RAILS_MAX_THREADS` and `SIDEKIQ_CONCURRENCY`
```
https://github.com/chatwoot/chatwoot/blob/4d719a8fe33bed72ec57812e174dab1874315340/config/database.yml#L7
```
Ref:
- https://stackoverflow.com/questions/40412611/in-puma-how-do-i-calculate-db-connections
<Note>
If you have a database server with higher resources available, you can leverage it by bumping up the number of rails and sidekiq pods so that more of the connection limit is being used.
</Note>
### FAQ
## Getting `ActiveRecord::ConnectionTimeoutError` errors.
There is a potential bug with Chatwoot's implementation of `rack-timeout`, in specific installations, which results in connections not being released properly. For the time being, you can set the following environment variable to disable `rack-timeout` if you are experiencing this.
```
RACK_TIMEOUT_SERVICE_TIMEOUT=0
```
@@ -0,0 +1,85 @@
---
title: GCS Bucket
description: Configure Google Cloud Storage bucket as storage in Chatwoot
sidebarTitle: GCS Bucket
---
Chatwoot supports Google Cloud storage as the storage provider. To enable GCS in Chatwoot, follow the below mentioned steps.
Set google as the active storage service in the environment variables
```bash
ACTIVE_STORAGE_SERVICE='google'
```
## Get project ID variable
Login to your Google Cloud console. On your home page of your project you will be able to see the project id and project name as follows.
![get-your-project-id](/self-hosted/images/get-your-project-id.png)
```bash
GCS_PROJECT=your-project-id
```
## Setup GCS Bucket
Go to Storage -> Browser. Click on "Create Bucket". You will be presented with a screen as shown below. Select the default values and continue.
![create-a-bucket](/self-hosted/images/create-a-bucket.png)
Once this is done you will get the bucket name. Set this as GCS_BUCKET.
```bash
GCS_BUCKET=your-bucket-name
```
## Setup a service account
Go to `Identity & Services -> Identity -> Service Accounts`. Click on "Create Service Account".
Provice a name and an ID for the service account, click on create. You will be asked to "Grant this service account access to the project" Select Cloud Storage -> Storage Admin as shown below.
![storage-admin](/self-hosted/images/storage-admin.png)
## Add service account to the bucket
Go to Storage -> Browser -> Your bucket -> Permissions. Click on add. On "New members" field select the service account you just created.
Select role as `Cloud Storage -> Storage Admin` and save.
![permissions](/self-hosted/images/permissions.png)
## Generate a key for the service account
Go to `Identity & Services -> Identity -> Service Accounts -> Your service account`. There is a section called **Keys**. Click on **Add Key**. You will be presented with an option like the one below. Select JSON from the option.
![json](/self-hosted/images/json.png)
Copy the json file content and set it as GCS_CREDENTIALS
A sample credential file is of the following format.
```json
{
"type": "service_account",
"project_id": "",
"private_key_id": "",
"private_key": "",
"client_email": "",
"client_id": "",
"auth_uri": "",
"token_uri": "",
"auth_provider_x509_cert_url": "",
"client_x509_cert_url": ""
}
```
When pasting the credentials to the ENV file, make sure to remove the new lines and paste it into a single line.
```bash
GCS_CREDENTIALS={"type": "service_account","project_id": "","private_key_id": "","private_key": "","client_email": "","client_id": "","auth_uri": "","token_uri": "","auth_provider_x509_cert_url": "","client_x509_cert_url": ""}
```
<Note>
If you are running Chatwoot v2.17+, make sure to wrap `GCS_CREDENTIALS` in single quotes.
</Note>
@@ -0,0 +1,103 @@
---
title: S3 Bucket
description: Configure Amazon S3 bucket as storage in Chatwoot
sidebarTitle: S3 Bucket
---
## Using Amazon S3
You can get started with [Creating an S3 bucket](https://docs.aws.amazon.com/AmazonS3/latest/gsg/CreatingABucket.html) and [Create an IAM user](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users_create.html) to configure the following details.
Configure the following env variables.
```bash
ACTIVE_STORAGE_SERVICE='amazon'
S3_BUCKET_NAME=
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_REGION=
```
## S3 Bucket policy
Inorder to use S3 bucket in Chatwoot, a policy has to be set with the correct credentials. A sample policy is given below, as the listed actions are required for the storage to work.
```json
{
"Version": "2012-10-17",
"Id": "Policyxxx",
"Statement": [
{
"Sid": "Stmtxxx",
"Effect": "Allow",
"Principal": {
"AWS": "your-user-arn"
},
"Action": [
"s3:DeleteObject",
"s3:GetObject",
"s3:ListBucket",
"s3:PutObject"
],
"Resource": [
"arn:aws:s3:::your-bucket-name",
"arn:aws:s3:::your-bucket-name/*"
]
}
]
}
```
Replace your *bucket name* in the appropriate places.
**User ARN** can be found using the following steps:
1. Login to AWS Console. Go to IAM, and click on Users from the left sidebar. You will be to see the list of users as follows.
![s3-users-list](/self-hosted/images/s3-users-list.png)
2. Click on the user, you will be to see a screen as shown below. Copy the User ARN and paste it in the above policy.
![user-arn](/self-hosted/images/user-arn.png)
**Add CORS Configuration on your S3 buckets**
You need to configure CORS settings to the respective storage cloud to support Direct file uploads from the widget and the Chatwoot dashboard.
Refer to this link for more information: https://edgeguides.rubyonrails.org/active_storage_overview.html#cross-origin-resource-sharing-cors-configuration
To make CORS configuration changes on S3:
1. Go to your S3 bucket
2. Click on the permissions tab.
3. Scroll to Cross-origin resource sharing (CORS) and click on `Edit` and add the respective changes shown below.
![aws-cors-setup](/self-hosted/images/aws-cors-setup.png)
Add your Chatwoot URL to the `AllowedOrigin` as shown below.
```json
[
{
"AllowedHeaders": [
"*"
],
"AllowedMethods": [
"PUT",
"POST",
"DELETE",
"GET"
],
"AllowedOrigins": [
"<add-your-domain-here eg: https://app.chatwoot.com>"
],
"ExposeHeaders": [
"Origin",
"Content-Type",
"Content-MD5",
"Content-Disposition"
],
"MaxAgeSeconds": 3600
}
]
```
@@ -0,0 +1,92 @@
---
title: Supported Providers
description: Configure cloud storage providers for Chatwoot file storage
sidebarTitle: Supported Providers
---
# Configure Cloud Storage
Chatwoot uses [Active Storage](https://edgeguides.rubyonrails.org/active_storage_overview.html) for storing attachments. The default storage option is local storage on your server, but you can configure cloud providers for better scalability and backup.
<Tip>
It is recommended to use a cloud provider for your Chatwoot storage to ensure proper backup of stored attachments and prevent data loss.
</Tip>
## Using Amazon S3
You can get started with [Creating an S3 bucket](https://docs.aws.amazon.com/AmazonS3/latest/gsg/CreatingABucket.html) and [Create an IAM user](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users_create.html) to configure the following details.
Configure the following env variables.
```bash
ACTIVE_STORAGE_SERVICE=amazon
S3_BUCKET_NAME=
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_REGION=
```
## Using Google GCS
<Note>
Starting with version 2.17+, wrap the `GCS_CREDENTIALS` environment variable in single quotes.
</Note>
Configure the following env variables.
```bash
ACTIVE_STORAGE_SERVICE=google
GCS_PROJECT=
GCS_CREDENTIALS=
GCS_BUCKET=
```
The value of the `GCS_CREDENTIALS` should be a json formatted string containing the following keys.
```bash
{
"type": "service_account",
"project_id" : "",
"private_key_id" : "",
"private_key" : "",
"client_email" : "",
"client_id" : "",
"auth_uri" : "",
"token_uri" : "",
"auth_provider_x509_cert_url" : "",
"client_x509_cert_url" : ""
}
```
When pasting the credentials to the ENV file, make sure to remove the new lines and paste it into a single line.
```bash
GCS_CREDENTIALS={"type": "service_account","project_id": "","private_key_id": "","private_key": "","client_email": "","client_id": "","auth_uri": "","token_uri": "","auth_provider_x509_cert_url": "","client_x509_cert_url": ""}
```
## Using Microsoft Azure
Configure the following env variables.
```bash
ACTIVE_STORAGE_SERVICE=microsoft
AZURE_STORAGE_ACCOUNT_NAME=
AZURE_STORAGE_ACCESS_KEY=
AZURE_STORAGE_CONTAINER=
```
## Using Amazon S3 Compatible Service
To use an s3 compatible service such as [DigitalOcean Spaces](https://www.digitalocean.com/docs/spaces/resources/s3-sdk-examples/#configure-a-client), Minio etc..
Configure the following env variables.
```bash
ACTIVE_STORAGE_SERVICE=s3_compatible
STORAGE_BUCKET_NAME=
STORAGE_ACCESS_KEY_ID=
STORAGE_SECRET_ACCESS_KEY=
STORAGE_REGION=nyc3
STORAGE_ENDPOINT=https://nyc3.digitaloceanspaces.com
#set force_path_style to true if using minio
#STORAGE_FORCE_PATH_STYLE=true
```
@@ -0,0 +1,100 @@
---
title: Chatwoot CTL
description: CLI tool to install and manage a self hosted Chatwoot Linux installation
sidebarTitle: Chatwoot CTL
---
## Introduction
Chatwoot CTL(`cwctl`) is CLI tool to install and manage a self hosted Chatwoot Linux installation.
`cwctl` aims to abstract away the common bash interactions with a Chatwoot installation and provide an easy to use syntax. This is not intended to be a full replacement.
If you are running a Chatwoot v2.7.0 instance or later, `cwctl` would have been already installed for you as part of installation.
Check if `cwctl` is already installed by
```bash
cwctl --version
```
If `cwctl` is not present, follow the steps below to install Chatwoot CTL.
### Install or Upgrade Chatwoot CTL
If you used an older version of install script(< 2.0), you will not have `cwctl` in your PATH. To install/upgrade Chatwoot CTL,
```bash
wget https://get.chatwoot.app/linux/install.sh -O /usr/local/bin/cwctl && chmod +x /usr/local/bin/cwctl
cwctl --help
```
<Note>
The above command requires root access to install `cwctl` to `/usr/local/bin`.
</Note>
### Help
To learn more about the options supported by `cwctl`,
```bash
sudo cwctl --help
```
### Upgrading to a newer version of Chatwoot
Whenever a new version of Chatwoot is released, use the following steps to upgrade your instance.
```bash
sudo cwctl --upgrade
```
<Note>
This will upgrade your Chatwoot instance to the latest stable release. If you are running a custom branch in production do not use this to upgrade.
</Note>
### Setup Nginx with SSL after installation
To set up Nginx with SSL after initial setup(if you answered `no` to webserver/SSL setup during the first install)
<Note>
Please add an A record pointing to your Chatwoot instance IP before proceeding.
</Note>
```bash
sudo cwctl --webserver
```
### Restart Chatwoot
```bash
sudo cwctl --restart
```
### Running Rails Console
```bash
sudo cwctl --console
```
### Viewing Logs
For Chatwoot web(rails) server logs use,
```bash
sudo cwctl --logs web
```
For Chatwoot worker(sidekiq) server logs use,
```bash
sudo cwctl --logs worker
```
### Version
To check the version of Chatwoot CTL,
```bash
sudo cwctl --version
```
@@ -0,0 +1,205 @@
---
title: Docker Chatwoot Production deployment guide
description: Deploy Chatwoot using Docker containers for production environments
sidebarTitle: Docker
---
## Pre-requisites
Before proceeding, make sure you have the latest version of `docker` and `docker-compose` installed.
As of now [at the time of writing this doc], we recommend a version equal to or higher than the following.
```bash
$ docker --version
Docker version 20.10.10, build b485636
$ docker compose version
Docker Compose version v2.14.1
```
<Note>
Container name uses dashes instead of underscores by default with new docker/compose versions. If you are using an older version of docker/compose, replace `-` with `_`. Also, use `docker-compose` instead of `docker compose`.
</Note>
## Steps to deploy Chatwoot using docker-compose
### 1. Install Docker on your VM
```bash
# example in ubuntu
apt-get update
apt-get upgrade
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
apt install docker-compose-plugin
```
### 2. Download the required files
```bash
# Download the env file template
wget -O .env https://raw.githubusercontent.com/chatwoot/chatwoot/develop/.env.example
# Download the Docker compose template
wget -O docker-compose.yaml https://raw.githubusercontent.com/chatwoot/chatwoot/develop/docker-compose.production.yaml
```
### 3. Configure environment variables
Tweak the `.env` and `docker-compose.yaml` according to your preferences. Refer to the available [environment variables](/docs/self-hosted/configuration/environment-variables). You could also remove the dependant services like `Postgres`, `Redis` etc., in favor of managed services configured via environment variables.
```bash
# update redis and postgres passwords
nano .env
# update docker-compose.yaml same postgres pass
nano docker-compose.yaml
```
### 4. Prepare the database
```bash
docker compose run --rm rails bundle exec rails db:chatwoot_prepare
```
### 5. Start the services
```bash
docker compose up -d
```
### 6. Access your installation
Your Chatwoot installation is complete. Please note that the containers are not exposed to the internet and they only bind to the localhost. Setup something like Nginx or any other proxy server to proxy the requests to the container.
If you want to verify whether the installation is working, try `curl -I localhost:3000/api` to see if it returns `200`. Also, you could temporarily drop the `127.0.0.1:3000:3000` for rails to `3000:3000` in the compose file to access your instance at `http://<your-external-ip>:3000`. It's recommended to revert this change back and use Nginx or some proxy server in the front.
## Additional Steps
1. Have an `Nginx` web server acting as a reverse proxy for Chatwoot installation. So that you can access Chatwoot from `https://chat.yourdomain.com`
2. Run `docker compose run --rm rails bundle exec rails db:chatwoot_prepare` whenever you decide to update the Chatwoot images to handle the migrations.
### Configure Nginx and Let's Encrypt
#### 1. Configure Nginx to serve as a frontend proxy
```bash
sudo apt-get install nginx
cd /etc/nginx/sites-enabled
nano yourdomain.com.conf
```
#### 2. Use the following Nginx config
Use the following Nginx config after replacing the `yourdomain.com` in `server_name`.
```nginx
server {
server_name <yourdomain.com>;
# Point upstream to Chatwoot App Server
set $upstream 127.0.0.1:3000;
# Nginx strips out underscore in headers by default
# Chatwoot relies on underscore in headers for API
# Make sure that the config is set to on.
underscores_in_headers on;
location /.well-known {
alias /var/www/ssl-proof/chatwoot/.well-known;
}
location / {
proxy_pass_header Authorization;
proxy_pass http://$upstream;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Ssl on; # Optional
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
proxy_buffering off;
client_max_body_size 0;
proxy_read_timeout 36000s;
proxy_redirect off;
}
listen 80;
}
```
#### 3. Verify and reload Nginx config
```bash
nginx -t
systemctl reload nginx
```
#### 4. Run Let's Encrypt to configure SSL certificate
```bash
apt install certbot
apt-get install python3-certbot-nginx
mkdir -p /var/www/ssl-proof/chatwoot/.well-known
certbot --webroot -w /var/www/ssl-proof/chatwoot/ -d yourdomain.com -i nginx
```
#### 5. Access your installation
Your Chatwoot installation should be accessible from the `https://yourdomain.com` now.
## Steps to build images yourself
We publish our base images to the Docker hub. You should be able to build your Chatwoot web/worker images from these base images.
### Web
```dockerfile
FROM chatwoot/chatwoot:latest
RUN chmod +x docker/entrypoints/rails.sh
ENTRYPOINT ["docker/entrypoints/rails.sh"]
CMD bundle exec bundle exec rails s -b 0.0.0.0 -p 3000
```
### Worker
```dockerfile
FROM chatwoot/chatwoot:latest
RUN chmod +x docker/entrypoints/rails.sh
ENTRYPOINT ["docker/entrypoints/rails.sh"]
CMD bundle exec sidekiq -C config/sidekiq.yml
```
The app servers will run available on port `3000`. Ensure the images connect to the same database and Redis servers. Provide the configuration for these services via [environment variables](/docs/self-hosted/configuration/environment-variables).
### Initial database setup
To set up the database for the first time, you must run `rails db:chatwoot_prepare`. You may get errors if you try to run `rails db:migrate` at this point.
## Upgrading
If you're not using the `latest` or `latest-ce` tag, you first need to change the desired tag in your docker-compose file.
After that you can pull the new image and start using them:
```bash
docker compose pull
docker compose up -d
```
Finally you may need to update the database:
```bash
docker compose run --rm rails bundle exec rails db:chatwoot_prepare
```
## Running Rails Console
```bash
docker exec -it $(basename $(pwd))-rails-1 sh -c 'RAILS_ENV=production bundle exec rails c'
```
## Chatwoot CE edition docker images
If you want to run Chatwoot CE edition, replace the docker image tag with equivalent foss version tag. Docker tag for current `master` would be `latest-ce`. Version specific tags would follow the pattern `v*-ce`. For example the docker ce edition tag for Chatwoot `v2.3.2` would be `v2.3.2-ce`.
@@ -0,0 +1,234 @@
---
title: Deploy Chatwoot on Kubernetes using Helm Charts
description: Deploy Chatwoot on Kubernetes using our official Helm charts
sidebarTitle: Kubernetes
---
This guide will help you to deploy a production ready Chatwoot instance with Helm Charts.
To quickly try out the charts, follow the two steps below. For a production deployment, please make sure to pass in the required arguments to helm using your custom `values.yaml` file.
```bash
helm repo add chatwoot https://chatwoot.github.io/charts
helm install chatwoot chatwoot/chatwoot
```
<iframe frameborder="0" scrolling="no" marginheight="0" marginwidth="0"width="100%" height="443" type="text/html" src="https://www.youtube-nocookie.com/embed/o1jnYfy8CCo"></iframe>
## Prerequisites
- Kubernetes 1.16+
- Helm 3.1.0+
- PV provisioner support in the underlying infrastructure
The helm installation will create 3 "Persistent Volume Claims" for redis, rails and postgres. Setup up a default "Storage Class" (for automatic PV) or create 3 "Persistent Volumes" with the size of 8GB, before installing chatwoot. If the "Persistent Volume Claims" do not claim the "Persistent Volumes", leave storageClassName blank (inside the PV .yaml files).
## Installing the chart
To install the chart with the release name `chatwoot`, use the following. To deploy it in `chatwoot` namespace, pass `-n chatwoot` to the command.
```bash
helm install chatwoot chatwoot/chatwoot -f <your-custom-values.yaml> #-n chatwoot
```
The command deploys Chatwoot on the Kubernetes cluster in the default configuration. The [parameters](#parameters) section lists the parameters that can be configured during installation.
<Tip>
List all releases using `helm list`
</Tip>
## Uninstalling the chart
To uninstall/delete the `chatwoot` deployment:
```bash
helm delete chatwoot
```
The command removes all the Kubernetes components associated with the chart and deletes the release.
<Note>
Persistent volumes are not deleted automatically. They need to be removed manually.
</Note>
## Parameters
### Chatwoot Image parameters
| Name | Description | Value |
| ------------------- | ---------------------------------------------------- | ---------------------- |
| `image.repository` | Chatwoot image repository | `chatwoot/chatwoot` |
| `image.tag` | Chatwoot image tag (immutable tags are recommended) | `v2.16.0` |
| `image.pullPolicy` | Chatwoot image pull policy | `IfNotPresent` |
### Chatwoot Environment Variables
| Name | Type | Default Value |
| ------------------------------------ | ------------------------------------------------------------------- | ---------------------------------------------------------- |
| `env.ACTIVE_STORAGE_SERVICE` | Storage service. `local` for disk. `amazon` for s3. | `"local"` |
| `env.ASSET_CDN_HOST` | Set if CDN is used for asset delivery. | `""` |
| `env.INSTALLATION_ENV` | Sets chatwoot installation method. | `"helm"` |
| `env.ENABLE_ACCOUNT_SIGNUP` | `true` : default option, allows sign ups, `false` : disables all the end points related to sign ups, `api_only`: disables the UI for signup but you can create sign ups via the account apis. | `"false"` |
| `env.FORCE_SSL` | Force all access to the app over SSL, default is set to false. | `"false"` |
| `env.FRONTEND_URL` | Replace with the URL you are planning to use for your app. | `"http://0.0.0.0:3000/"` |
| `env.IOS_APP_ID` | Change this variable only if you are using a custom build for mobile app. | `"6C953F3RX2.com.chatwoot.app"` |
| `env.ANDROID_BUNDLE_ID` | Change this variable only if you are using a custom build for mobile app. | `"com.chatwoot.app"` |
| `env.ANDROID_SHA256_CERT_FINGERPRINT`| Change this variable only if you are using a custom build for mobile app. | `"AC:73:8E:DE:EB:5............"` |
| `env.MAILER_SENDER_EMAIL` | The email from which all outgoing emails are sent. | `""` |
| `env.RAILS_ENV` | Sets rails environment. | `"production"` |
| `env.RAILS_MAX_THREADS` | Number of threads each worker will use. | `"5"` |
| `env.SECRET_KEY_BASE` | Used to verify the integrity of signed cookies. Ensure a secure value is set. | `replace_with_your_super_duper_secret_key_base` |
| `env.SENTRY_DSN` | Sentry data source name. | `""` |
| `env.SMTP_ADDRESS` | Set your smtp address. |`""` |
| `env.SMTP_AUTHENTICATION` | Allowed values: `plain`,`login`,`cram_md5` | `"plain"` |
| `env.SMTP_ENABLE_STARTTLS_AUTO` | Defaults to true. | `"true"` |
| `env.SMTP_OPENSSL_VERIFY_MODE` | Can be: `none`, `peer`, `client_once`, `fail_if_no_peer_cert` | `"none"` |
| `env.SMTP_PASSWORD` | SMTP password | `""` |
| `env.SMTP_PORT` | SMTP port | `"587"` |
| `env.SMTP_USERNAME` | SMTP username | `""` |
| `env.USE_INBOX_AVATAR_FOR_BOT` | Bot customizations | `"true"` |
### Email setup for conversation continuity (Incoming emails)
| Name | Type | Default Value |
| ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- |
| `env.MAILER_INBOUND_EMAIL_DOMAIN` | This is the domain set for the reply emails when conversation continuity is enabled. | `""` |
| `env.RAILS_INBOUND_EMAIL_SERVICE` | Set this to appropriate ingress channel with regards to incoming emails. Possible values are `relay`, `mailgun`, `mandrill`, `postmark` and `sendgrid`. | `""` |
| `env.RAILS_INBOUND_EMAIL_PASSWORD` | Password for the email service. | `""` |
| `env.MAILGUN_INGRESS_SIGNING_KEY` | Set if using mailgun for incoming conversations. | `""` |
| `env.MANDRILL_INGRESS_API_KEY` | Set if using mandrill for incoming conversations. | `""` |
### Postgres variables
| Name | Type | Default Value |
| ----------------------------------- | ----------------------------------------------------------------------------- | ------------------------------------------------ |
| `postgresql.enabled` | Set to `false` if using external postgres and modify the below variables. | `true` |
| `postgresql.auth.database` | Chatwoot database name | `chatwoot_production` |
| `postgresql.postgresqlHost` | Postgres host. Edit if using external postgres. | `""` |
| `postgresql.auth.postgresPassword` | Postgres password. Edit if using external postgres. | `postgres` |
| `postgresql.postgresqlPort` | Postgres port | `5432` |
| `postgresql.auth.username` | Postgres username. | `postgres` |
### Redis variables
| Name | Type | Default Value |
| ----------------------------------- | ------------------------------------------------------------------------- | --------------------------------------------------- |
| `redis.auth.password` | Password used for internal redis cluster | `redis` |
| `redis.enabled` | Set to `false` if using external redis and modify the below variables. | `true` |
| `redis.host` | Redis host name | `""` |
| `redis.port` | Redis port | `""` |
| `redis.password` | Redis password | `""` |
| `env.REDIS_TLS` | Set to `true` if TLS(`rediss://`) is required | `false` |
| `env.REDIS_SENTINELS` | Redis Sentinel can be used by passing list of sentinel host and ports. | `""` |
| `env.REDIS_SENTINEL_MASTER_NAME` | Redis sentinel master name is required when using sentinel. | `""` |
### Logging variables
| Name | Type | Default Value |
| ----------------------------------- | ------------------------------------------------------------------- | ---------------------------------------------------------- |
| `env.RAILS_LOG_TO_STDOUT` | string | `"true"` |
| `env.LOG_LEVEL` | string | `"info"` |
| `env.LOG_SIZE` | string | `"500"` |
### Third party credentials
| Name | Type | Default Value |
| ----------------------------------- | -------------------------------------------------------------------- | ---------------------------------------------------------- |
| `env.S3_BUCKET_NAME` | S3 bucket name | `""` |
| `env.AWS_ACCESS_KEY_ID` | Amazon access key ID | `""` |
| `env.AWS_REGION` | Amazon region | `""` |
| `env.AWS_SECRET_ACCESS_KEY` | Amazon secret key ID | `""` |
| `env.FB_APP_ID` | For facebook channel https://www.chatwoot.com/docs/facebook-setup | `""` |
| `env.FB_APP_SECRET` | For facebook channel | `""` |
| `env.FB_VERIFY_TOKEN` | For facebook channel | `""` |
| `env.SLACK_CLIENT_ID` | For slack integration | `""` |
| `env.SLACK_CLIENT_SECRET` | For slack integration | `""` |
| `env.TWITTER_APP_ID` | For twitter channel | `""` |
| `env.TWITTER_CONSUMER_KEY` | For twitter channel | `""` |
| `env.TWITTER_CONSUMER_SECRET` | For twitter channel | `""` |
| `env.TWITTER_ENVIRONMENT` | For twitter channel | `""` |
### Autoscaling
| Name | Type | Default Value |
| ----------------------------------- | -------------------------------------------------------------------- | ---------------------------------------------------------- |
| `web.hpa.enabled` | Horizontal Pod Autoscaling for Chatwoot web | `false` |
| `web.hpa.cputhreshold` | CPU threshold for Chatwoot web | `80` |
| `web.hpa.minpods` | Minimum number of pods for Chatwoot web | `1` |
| `web.hpa.maxpods` | Maximum number of pods for Chatwoot web | `10` |
| `web.replicaCount` | No of web pods if hpa is not enabled | `1` |
| `worker.hpa.enabled` | Horizontal Pod Autoscaling for Chatwoot worker | `false` |
| `worker.hpa.cputhreshold` | CPU threshold for Chatwoot worker | `80` |
| `worker.hpa.minpods` | Minimum number of pods for Chatwoot worker | `2` |
| `worker.hpa.maxpods` | Maximum number of pods for Chatwoot worker | `10` |
| `worker.replicaCount` | No of worker pods if hpa is not enabled | `1` |
## Install with custom parameters
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
```bash
helm install my-release \
--set env.FRONTEND_URL="chat.yourdomain.com"\
chatwoot/chatwoot
```
The above command sets the Chatwoot server frontend URL to `chat.yourdoamain.com`.
Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example,
```bash
helm install my-release -f values.yaml chatwoot/chatwoot
```
<Tip>
You can use the default `values.yaml` file.
</Tip>
## Postgres
PostgreSQL is installed along with the chart if you choose the default setup. To use an external Postgres DB, please set `postgresql.enabled` to `false` and set the variables under the Postgres section above.
## Redis
Redis is installed along with the chart if you choose the default setup. To use an external Redis DB, please set `redis.enabled` to `false` and set the variables under the Redis section above.
## Autoscaling
To enable horizontal pod autoscaling, set `web.hpa.enabled` and `worker.hpa.enabled` to `true`. Also make sure to uncomment the values under, `resources.limits` and `resources.requests`. This assumes your k8s cluster is already having a metrics-server. If not, deploy metrics-server with the following command.
```bash
kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
```
## Upgrading
Do `helm repo update` and check the version of charts that is going to be installed. Helm charts follows semantic versioning and so if the MAJOR version is different from your installed version, there might be breaking changes. Please refer to the changelog before upgrading.
```bash
# update helm repositories
helm repo update
# list your current installed version
helm list
# show the latest version of charts that is going to be installed
helm search repo chatwoot
```
```bash
#if it is major version update, refer to the changelog before proceeding
helm upgrade chatwoot chatwoot/chatwoot -f <your-custom-values>.yaml
```
## Troubleshooting
### pod has unbound immediate PersistentVolumeClaims
Make sure the "Persistent Volume Claims" can be satisfied. Refer to [prerequisites](#prerequisites).
### ActionController::InvalidAuthenticityToken HTTP Origin header
```
ActionController::InvalidAuthenticityToken HTTP Origin header (https://mydomain.com) didn't match request.base_url (http://mydomain.com)
```
If you are recieving the above error when trying to access the superadmin panel, configure your ingress controller to forward the protocol of the origin request. For `nginx` ingress, you can do this by setting the `proxy_set_header X-Forwarded-Proto https;` config. Refer this [issue](https://github.com/chatwoot/chatwoot/issues/5506) to learn more.
@@ -0,0 +1,187 @@
---
title: Production deployment guide for Linux VM
description: Deploy Chatwoot on Ubuntu 24.04 LTS using the automated installation script
sidebarTitle: Linux VM
---
## Deploying to Linux VM
This guide will help you install **Chatwoot** on **Ubuntu 24.04 LTS**. We have prepared a deployment script for you to run. Refer to the script and feel free to make changes accordingly to the operating system if you are on a non-Ubuntu system.
<iframe width="100%" height="443" src="https://www.youtube-nocookie.com/embed/vu_61D1VFAk" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
## Steps to install
<Note>
If you plan to use a domain with chatwoot, please add an A record before proceeding. Refer to the `Configuring the installation domain` section below.
</Note>
### 1. Create an install.sh file
```bash
wget https://get.chatwoot.app/linux/install.sh
chmod +x install.sh
```
### 2. Execute the script
The script will take care of the initial **Chatwoot** setup.
```bash
./install.sh --install
```
### 3. Access your installation
**Chatwoot** Installation will now be accessible at `http://{your_ip_address}:3000` or if you opted for domain setup, it will be at `https://chatwoot.mydomain.com`.
<Note>
This will also install the Chatwoot CLI(`cwctl`) starting with Chatwoot v2.7.0. Use `cwctl --help` to learn more.
</Note>
## Configuring The installation Domain
1. Create an `A` record for `chatwoot.mydomain.com` on your domain management system and point it towards the installation IP address.
2. Continue with the installation script by entering `yes` when prompted about domain setup.
3. Enter your domain. The script will take care of configuring Nginx and SSL via LetsEncrypt.
4. Your Chatwoot installation should be accessible from `https://chatwoot.mydomain.com` now.
## Configure the required environment variables
For your Chatwoot installation to properly function, you would need to configure the essential environment variables like `FRONTEND_URL`, Mailer, and a cloud storage config. Refer **[Environment variables](/docs/self-hosted/configuration/environment-variables)** for the full list.
### 1. Login as chatwoot user and edit the .env file
```bash
# Login as chatwoot user
sudo -i -u chatwoot
cd chatwoot
nano .env
```
### 2. Update environment variables
Refer **[Environment variables](/docs/self-hosted/configuration/environment-variables)** and update the required variables. Save the `.env` file.
### 3. Restart the Chatwoot server
<Note>
If you have Chatwoot CLI(`cwctl`) installed, use `cwctl -r`.
</Note>
```bash
sudo systemctl restart chatwoot.target
```
## Upgrading to a newer version of Chatwoot
Whenever a new version of Chatwoot is released, use the following steps to upgrade your instance.
<Note>
If you have Chatwoot CLI(`cwctl`) installed, use `cwctl --upgrade` to upgrade your Chatwoot installation.
</Note>
To install `cwctl`, refer [this](#install-or-upgrade-chatwoot-cli) section below.
<Note>
If you are on an older version of Chatwoot(< 2.7), follow the manual upgrade steps below if you face errors with `cwctl`.
</Note>
Run the following steps on your VM. Make changes based on your OS if you are on a non-Ubuntu system.
```bash
# Login as Chatwoot user
sudo -i -u chatwoot
# Navigate to the Chatwoot directory
cd chatwoot
# Pull the latest version of the master branch
git checkout master && git pull
# Ensure the ruby version is upto date
rvm install "ruby-3.3.3"
rvm use 3.3.3 --default
# Update dependencies
bundle
pnpm i
# Recompile the assets
rake assets:precompile RAILS_ENV=production
# Migrate the database schema
RAILS_ENV=production bundle exec rake db:migrate
# Switch back to root user
exit
# Copy the updated targets
cp /home/chatwoot/chatwoot/deployment/chatwoot-web.1.service /etc/systemd/system/chatwoot-web.1.service
cp /home/chatwoot/chatwoot/deployment/chatwoot-worker.1.service /etc/systemd/system/chatwoot-worker.1.service
cp /home/chatwoot/chatwoot/deployment/chatwoot.target /etc/systemd/system/chatwoot.target
# Reload systemd files
systemctl daemon-reload
# Restart the chatwoot server
systemctl restart chatwoot.target
```
## Running Rails Console
<Note>
If you have Chatwoot CLI(`cwctl`) installed, use `cwctl -c`.
</Note>
```bash
# Login as Chatwoot user
sudo -i -u chatwoot
# Navigate to the Chatwoot directory
cd chatwoot
# start rails console
RAILS_ENV=production bundle exec rails c
```
## Viewing Logs
<Note>
If you have Chatwoot CLI(`cwctl`) installed, use `cwctl -l web` or `cwctl -l worker`.
</Note>
Run the following commands in your ubuntu shell
```bash
# logs from the rails server
journalctl -u chatwoot-web.1.service -f
# logs from sidekiq
journalctl -u chatwoot-worker.1.service -f
```
## Install or Upgrade Chatwoot CLI
If you used an older version of install script(< 2.0), you will not have `cwctl` in your PATH. To install/upgrade Chatwoot CLI,
```bash
wget https://get.chatwoot.app/linux/install.sh -O /usr/local/bin/cwctl && chmod +x /usr/local/bin/cwctl
cwctl --help
```
<Note>
The above command requires root access to install `cwctl` to `/usr/local/bin`.
</Note>
## Troubleshooting
### If precompile fails
If the asset precompilation step fails with `ActionView::Template::Error (Webpacker can't find application.css in /home/chatwoot/chatwoot/public/packs/manifest.json)` or if you face issues while restarting the server, try the following command and restart the server.
```bash
RAILS_ENV=production rake assets:clean assets:clobber assets:precompile
```
This command would clear the existing compiled assets and would recompile all the assets. Read more about it [here](https://edgeguides.rubyonrails.org/command_line.html#bin-rails-assets)
Binary file not shown.

After

Width:  |  Height:  |  Size: 435 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 247 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 357 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 357 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 306 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 274 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 241 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 307 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 520 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 274 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 791 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 911 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 735 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 717 KiB

Some files were not shown because too many files have changed in this diff Show More