Tutorials on wiring up a LINE Bot are everywhere. But once the tutorial is done and the bot is replying on your laptop, there is a question almost nobody answers: where is it going to run?
That is all this article is about.
30-second overview
| Item | Details |
|---|---|
| LINE's hard requirements | Public HTTPS, always online, responds immediately |
| The free-tier trap | Cold start longer than the webhook timeout |
| The problem with ngrok | On the free plan the URL changes on every restart |
| For rule-based bots | n8n (avg. NT$499/mo, billed yearly) |
| For conversational bots | Dify (NT$1,599) |
LINE webhooks: three hard requirements
A LINE official account delivers messages to your program through a webhook, and it makes three non-negotiable demands of your service:
- It has to be a publicly reachable HTTPS URL. Not http, not a private network address, and the certificate has to be valid.
- It has to be online all the time. Users don't pick a convenient moment to message you; if your service dies at 2 a.m., those messages simply go unanswered.
- It has to respond immediately. LINE enforces a webhook timeout, and a reply that is too slow counts as a failure.
None of these sounds dramatic, but they are exactly where beginners get stuck at deployment time.
Why the usual free approaches break
Tunnels like ngrok
Great during development, not viable in production. On the free plan the URL changes on every restart, and the webhook URL in the LINE console has to be filled in by hand. The moment the URL changes, the bot goes silent — and nobody tells you.
Free cloud plans that sleep
This is the most insidious trap. Many free plans put a service to sleep after a period without traffic and only wake it on the next request. Waking takes time, and that cold start often exceeds LINE's webhook timeout.
The result: everything works when you test it (because you just used it, so it's warm), but the first message a real user sends a few hours later gets no reply. It is a hard problem to diagnose, because it doesn't happen every time.
Your own VPS
Workable, and completely under your control. The price is that SSL certificate renewals, restarting the service when it dies, and system updates all become your job. For someone who just wants one bot, that is learning an entire skill set for the sake of a single thing.
The three approaches side by side
| ngrok / local machine | Your own VPS | Managed hosting | |
|---|---|---|---|
| Stable URL | No (free plan) | Yes | Yes |
| SSL certificate | Automatic | You renew it | Automatic |
| Online 24 hours | Only while your computer is on | Yes | Yes |
| Auto-restart after a crash | No | You set it up | Yes |
| Right stage | Development and testing | Production, if you can run ops | Production |
n8n or Dify?
Both can run a LINE Bot, but they suit different kinds of bot. This is the first thing to settle when choosing.
| n8n | Dify | |
|---|---|---|
| Strength | Rule-based workflows | Conversational AI |
| Typical use | Keyword received → query the database → reply in a fixed format | Understand a natural-language question → answer from a knowledge base |
| Does it need an AI model | Optional | Required, and you pay the model charges |
| Plan | avg. NT$499/mo (billed yearly) | NT$1,599/mo |
A simple test: if what your bot answers is something that can be looked up, use n8n; if it has to understand the question before it can answer, use Dify.
Checking order status, reporting today's exchange rate, alerting on low stock — those are n8n. Answering the many ways a customer might phrase a product question, or finding an answer inside a document — those are Dify.
On RoamerHost both services come with their own subdomain and automatic SSL, so the webhook URL works out of the box with no certificate handling on your side. And the URL doesn't change.
When you don't need paid hosting
To be clear: if nobody would care that this bot is down, a free plan is fine.
A toy you built for yourself, a group bot a few friends use, a prototype that is still validating an idea — in those cases a cold start of a dozen seconds is not a problem, and re-entering the URL occasionally is not a problem either. Paying for stability buys you the situations where someone is waiting on that reply.
Conversely, if this bot is the front line of your customer support, or you get a phone call when it fails to answer, then it needs to be online 24 hours a day, just like your website.
Pre-launch checklist
- The webhook URL points at production, not your test URL
- The workflow is set to active
- Test it for real from a second LINE account — not just your own
- Test again a few hours later — that is the only way to catch cold starts
Item four is the crucial one. Tests right after deployment always pass; the problem shows up once the service has been idle.
The nastiest failure mode
The cold start problem on free cloud plans deserves its own section, because it is nearly impossible to reproduce on your own.
You have just deployed and just tested, so the service is warm, responses are fast, everything looks fine. Then a few hours pass with no traffic and the service goes to sleep. The first message from a real user triggers a wake-up, and the wake-up takes longer than LINE's webhook timeout — so that message gets no reply.
Then the service is awake, you test again, and it works.
The symptom is "it occasionally doesn't respond", and it only happens to real users. You can chase that one for a long time.
FAQ
Q: Can I go live straight from local development?
No. LINE needs a publicly reachable HTTPS URL that is always online. Shut down your computer and the bot stops.
Q: Is free-tier ngrok good enough?
For development, yes; for production, no. The URL changes on every restart, and the webhook URL in the LINE console is entered by hand — the moment it changes the bot goes silent, and nobody tells you.
Q: Should I pick n8n or Dify?
The test: if what the bot answers can be looked up, use n8n; if it has to understand the question before answering, use Dify. Order lookups and exchange rates are the former; answering customers' many phrasings is the latter.
Q: Can I use both together?
Yes, and it is a common combination — Dify does the understanding, n8n does the execution. The division of labor is covered in Dify plus n8n.
Q: When is a free plan enough?
When nobody would care that the bot is down. A toy you built for yourself, a group bot a few friends use, a prototype still validating an idea — a cold start of a dozen seconds isn't a problem there.
Sources and further reading
For the LINE platform's webhook specification, the official documentation is the authority:
- n8n official documentation — configuring the webhook node
- Dify official documentation
Further reading
- n8n webhooks and third-party integration guide
- What is n8n? An introduction to the workflow automation platform
- Dify tutorial: build your first AI chatbot
- What is Dify? An introduction to the no-code AI app platform
- RoamerHost n8n hosting plans
- RoamerHost Dify hosting plans
Want someone to build it for you?
If you would rather not assemble these workflows yourself, or the scale is big enough that you want someone planning alongside you, Roamer Tech (RoamerHost's parent company) takes on business process automation and custom AI agent development: