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
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:
# 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:
# In your .env file
FRONTEND_URL = https://your-ngrok-subdomain.ngrok.io
Access Line Developer Console : Go to Line Developer Console
Create a Provider (if you don’t have one)
Create a New Channel and select “Messaging API”
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:
Channel Name
LINE Channel ID
LINE Channel Secret
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:
# Start the development server
make run
# or
foreman start -f Procfile.dev
6. Create Line Channel in Chatwoot
Access Chatwoot : Go to your Chatwoot instance (http://localhost:3000 )
Navigate to Settings → Inboxes → Add Inbox
Select Line as the channel type
Enter Line Credentials :
Channel Name
LINE Channel ID
LINE Channel Secret
LINE Channel Token
Save Configuration
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:
Go to Line Developer Console → Your Channel → Messaging API
Find Webhook Settings
Set Webhook URL : Use the URL provided by Chatwoot
https://your-ngrok-subdomain.ngrok.io/webhooks/line/your-channel-id
Enable Webhook : Toggle the webhook to “Enabled”
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
Add your Line bot as a friend using the QR code or bot ID
Send a message to your Line bot
Check Ngrok logs to see if the webhook request is received
Check Chatwoot to see if a new conversation is created
Reply from Chatwoot to test bidirectional communication
Troubleshooting
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
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
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
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
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:
Test message flow between Line and Chatwoot
Configure agent assignments for Line conversations
Set up automated responses if needed
Explore rich message features for enhanced user experience
Review webhook logs for debugging
Getting Help
If you encounter issues:
Useful Resources
Your Line integration is now ready for development and testing! 💬
Responses are generated using AI and may contain mistakes.