Architecture

Where to Host a LINE Bot: Webhooks Can't Go Offline

Plenty of articles teach you to build a LINE Bot; few say where it should run. LINE's webhook requirements, why free tiers bite, and choosing n8n vs Dify.

E
Eric Founder, Roamer Tech · · 7 min read

Want to start now? One-click deploy your own service

No servers to set up, isolated container, automatic SSL, cancel renewal anytime.

See plans & pricing

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

ItemDetails
LINE's hard requirementsPublic HTTPS, always online, responds immediately
The free-tier trapCold start longer than the webhook timeout
The problem with ngrokOn the free plan the URL changes on every restart
For rule-based botsn8n (avg. NT$499/mo, billed yearly)
For conversational botsDify (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 machineYour own VPSManaged hosting
Stable URLNo (free plan)YesYes
SSL certificateAutomaticYou renew itAutomatic
Online 24 hoursOnly while your computer is onYesYes
Auto-restart after a crashNoYou set it upYes
Right stageDevelopment and testingProduction, if you can run opsProduction

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.

n8nDify
StrengthRule-based workflowsConversational AI
Typical useKeyword received → query the database → reply in a fixed formatUnderstand a natural-language question → answer from a knowledge base
Does it need an AI modelOptionalRequired, and you pay the model charges
Planavg. 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

  1. The webhook URL points at production, not your test URL
  2. The workflow is set to active
  3. Test it for real from a second LINE account — not just your own
  4. 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:

Further reading

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:

Ready to get started?

60 seconds after you subscribe, your service is installed automatically — you just use it, we handle the rest.

See plans & pricing

Billed monthly or yearly by plan · cancel renewal anytime

Hi, I'm Roamer! Tap me anytime with a question and I'll help you out.

Roamer

Roamer - AI assistant

Online
Roamer

Ask me anything, anytime — I'll do my best to help!

Powered by RoamerHost AI