To deploy a LINE bot you need three things: somewhere that runs your code around the clock behind a public HTTPS URL, that URL entered as the Webhook URL in the LINE Developers Console, and your Channel secret and Channel access token stored as environment variables on the server rather than in your code. LINE is specific about what that endpoint must do. The certificate has to come from a public certificate authority, every webhook has to get an HTTP 200 back within 2 seconds, and the reply token you use to answer must be used within one minute, and only once. If your bot already replies on your laptop, these are the steps between you and a live bot.
A LINE bot written in Python or Node.js, whether you wrote it yourself or had Claude Code or Codex write it, can run on RoamerHost's Vibe Coding Hosting. Upload the code or connect GitHub, and the platform installs dependencies, starts the app and sets up the URL and SSL. Your Webhook URL is simply https://your-name.roamerhost.com/callback. We compared the different places to run a bot (your own computer, free cloud tiers, a VPS, managed hosting) in where to host a LINE bot; this article is the hands-on part.
LINE requirements are summarized from the official LINE Developers documentation, checked in November 2026. SDK versions are the latest on PyPI and npm that month. If the official docs change, they take precedence.
What LINE expects from your server
When someone messages your LINE Official Account, the LINE Platform POSTs the event to your Webhook URL. That URL must be HTTPS with a certificate issued by an authority that mainstream browsers trust. Self-signed certificates are rejected, and a chain missing its intermediate certificate will also fail. Free certificates such as Let's Encrypt are fine. Each channel gets exactly one Webhook URL.
Timing is what catches most people. LINE's webhook error statistics log a request_timeout when your server doesn't respond within 2 seconds, and the docs recommend processing events asynchronously: acknowledge first, work later. If your bot calls an AI model or queries a database before answering, ten or twenty seconds is normal, so that work has to happen after the response. The reply token has its own clock too. LINE says to use it within one minute of receiving the webhook, use beyond that isn't guaranteed, and each token works once.
Two more details. When you click Verify in the console, LINE sends a request whose events array is empty, and your code must still return 200 instead of throwing. And Webhook redelivery is off by default. Turn it on and events that didn't get a 2xx are sent again, which means the same message can arrive more than once; LINE suggests checking webhookEventId for duplicates. LINE doesn't publish how many times or how often it retries, and says redelivery doesn't guarantee delivery, so a server that simply stays up still matters most.
Four things to fix in your code before deploying
Most LINE bot tutorials run on localhost. Before you move to a server, check these four points. It's also the checklist to hand your AI coding tool.
First, listen on 0.0.0.0 and the PORT environment variable instead of a hard-coded 3000 or 5000. Second, read the Channel secret and access token from environment variables; never commit them to the code or to GitHub. Third, verify the signature against the raw request body. LINE computes an HMAC-SHA256 of the whole body with your Channel secret and sends it in the x-line-signature header. Parse the JSON and serialize it again and the spacing or quotes change, and the signature no longer matches. Fourth, return 200 first and do the work afterwards, for the reasons above.
In Python, the official line-bot-sdk (v3, Python 3.10 or later) with FastAPI looks roughly like this:
import os
from fastapi import FastAPI, Request, BackgroundTasks, HTTPException
from linebot.v3 import WebhookParser
from linebot.v3.exceptions import InvalidSignatureError
from linebot.v3.messaging import ApiClient, Configuration, MessagingApi, ReplyMessageRequest, TextMessage
from linebot.v3.webhooks import MessageEvent, TextMessageContent
parser = WebhookParser(os.environ["LINE_CHANNEL_SECRET"])
config = Configuration(access_token=os.environ["LINE_CHANNEL_ACCESS_TOKEN"])
app = FastAPI()
@app.get("/")
def health():
return {"ok": True}
@app.post("/callback")
async def callback(request: Request, tasks: BackgroundTasks):
body = (await request.body()).decode("utf-8")
signature = request.headers.get("x-line-signature", "")
try:
events = parser.parse(body, signature)
except InvalidSignatureError:
raise HTTPException(status_code=400)
for event in events:
if isinstance(event, MessageEvent) and isinstance(event.message, TextMessageContent):
tasks.add_task(reply, event.reply_token, event.message.text)
return "OK"
def reply(token, text):
with ApiClient(config) as client:
MessagingApi(client).reply_message(
ReplyMessageRequest(reply_token=token, messages=[TextMessage(text=text)]))
This is the simplest possible echo bot. BackgroundTasks runs reply after the response has gone out, so LINE gets its 200 right away; to plug in an AI model, put the call inside reply. List fastapi and line-bot-sdk in requirements.txt and Vibe Coding Hosting detects FastAPI and starts it on PORT, so you don't need to write a start command. Flask works too; the official README example uses Flask.
In Node.js, the official @line/bot-sdk (the current v11 needs Node.js 22 or later) with Express:
const express = require("express");
const line = require("@line/bot-sdk");
const client = line.LineBotClient.fromChannelAccessToken({
channelAccessToken: process.env.LINE_CHANNEL_ACCESS_TOKEN,
});
const app = express();
app.get("/", (req, res) => res.send("ok"));
app.post("/callback", line.middleware({ channelSecret: process.env.LINE_CHANNEL_SECRET }), (req, res) => {
res.sendStatus(200);
for (const event of req.body.events) handleEvent(event).catch(console.error);
});
async function handleEvent(event) {
if (event.type !== "message" || event.message.type !== "text") return;
await client.replyMessage({
replyToken: event.replyToken,
messages: [{ type: "text", text: event.message.text }],
});
}
app.listen(process.env.PORT || 3000, "0.0.0.0");
line.middleware reads the raw body itself to check the signature. The official docs warn against mounting express.json() in front of it; if another parser gets there first, the middleware can't see the raw body and every request fails verification. We tested both snippets by signing requests ourselves with a dummy Channel secret: a valid signature gets 200, an invalid one is rejected.
Both snippets also answer GET / with ok. LINE never calls it, but the platform checks that your app responds before switching a new version live, and it gives you a quick way to see the bot is alive.
Deploying on Vibe Coding Hosting, from upload to a successful Verify
Once your project and its URL are set up, there are three ways to get code onto it: let your AI tool deploy over MCP (tested with Claude Code, Codex and Gemini CLI), upload the project as a ZIP, or connect a GitHub repo in the project page so every push deploys automatically, private repos included. The GitHub setup is the same as for a Lovable project, described in auto-deploying from GitHub to your own domain. Leave node_modules and .venv out; the platform reinstalls from package-lock.json or requirements.txt.
Next, environment variables. In the project page's environment variables section, add LINE_CHANNEL_SECRET and LINE_CHANNEL_ACCESS_TOKEN, copying the values from the LINE Developers Console: the Channel secret is under the channel's Basic settings, the access token under the Messaging API tab. Values are stored encrypted, and AI tools connected over MCP can't read them back. We'd still paste secrets into the project page yourself rather than into an AI chat. An uploaded .env file is deliberately not deployed, so secrets belong here. Changes take effect on the next deploy.
After a successful deploy, go back to the Messaging API tab, set the Webhook URL to https://your-name.roamerhost.com/callback and click Verify. Success means LINE can reach your app. Then switch on Use webhook. Finally, in LINE Official Account Manager, turn off the greeting message and auto-reply messages that are on by default, or users will get the account's canned reply and your bot's reply at the same time. Scan the QR code, add the bot as a friend, send a message and see if it answers.
To change the bot later, just deploy again. The new version starts alongside the old one and only takes over once it responds; if it fails, the old version stays live and LINE never notices. The platform keeps your last 3 successful versions for rollback. If you later attach your own domain, remember to update the Webhook URL in the LINE console too.
Five problems people hit after going live
Conversations vanish. Many tutorials keep user state in a variable inside the app, and a redeploy or restart wipes it. If the bot needs to remember what someone said or which step they're on, store it in a database. PostgreSQL and MariaDB are off by default on Vibe Coding Hosting and you turn one on when you need it; the connection string arrives in DATABASE_URL. For small amounts of data, a SQLite file in /data persists too.
Times are 8 hours off. The server clock is UTC. If the bot answers "what's today's date" or decides whether to reply based on business hours, set Asia/Taipei in your code, or set the TZ environment variable for Node.js.
The same message gets two replies. With Webhook redelivery on, you'll occasionally get a repeat event; check webhookEventId before acting.
You want to message users first. A reply token only answers what the user just sent. For a morning broadcast or a shipping notice you need push messages. Vibe Coding Hosting's scheduler calls a URL in your app on a timetable (Taipei time, as often as every 5 minutes, up to 120 seconds per run), and that route can call the push API. Note that LINE Official Account plans include a monthly number of free messages; push, multicast and broadcast count toward it, reply messages don't.
You can't tell what broke. The LINE Developers Console has webhook error statistics showing connection failures, timeouts and non-2xx responses. On the hosting side, both the project page and your AI tool can read your app's output logs and restart count. Look at both and it's usually obvious whether the problem is in the LINE settings or in your code.
Moving from Zeabur or another platform
Zeabur has announced that all services stop on December 31 and has asked users to move apps and data out by November 30 (see Zeabur's official notices for details). Moving a LINE bot is straightforward: put the code on the new host, set the environment variables again, change the Webhook URL and click Verify. The part to think about is your secrets. Both of Zeabur's security incidents, in August and October, exposed service environment variables. If your Channel secret or access token ever lived there, reissue them in the LINE Developers Console after the move. LINE notes that the old secret stops working once you reissue it, so have the new host ready, reissue, then immediately update the environment variables and redeploy. The full checklist is in our Zeabur alternative and migration guide.
People moving off free cloud tiers usually do it because of sleeping instances. Render's docs, for example, say a free web service spins down after 15 minutes without traffic, takes about a minute to wake, and shouldn't be used for production. Put that next to LINE's 2-second window and you get the classic symptom: the first message after a quiet few hours gets no answer. Apps on Vibe Coding Hosting stay running, don't sleep, and restart automatically if they crash.
Bots that don't fit here
A LINE bot is a web app that receives messages by webhook, which is squarely what Vibe Coding Hosting supports. Not every chat bot works that way. A Discord bot holds a persistent connection to Discord's gateway, and a Telegram bot in polling mode is also a long-running process with no web endpoint; neither is supported today. Also unsupported: a separate always-on background worker in the same project, bringing your own Redis or MongoDB, and GPUs for running AI models on the server. If you need those, look for a service that offers them.
One plan also hosts one app. A LINE bot with its admin dashboard in the same codebase is fine; a separate marketing site would need a second plan.
Which plan to choose
If you already have a LINE bot in Python or Node.js, written by you or by an AI, and you want a home that never sleeps, has a stable HTTPS URL and lets your AI deploy for you, choose Vibe Coding Hosting Basic, from NT$299 a month (NT$3,588 billed yearly), managed with your own AI tools over MCP. If you don't have code yet and want an AI to build an app with a dashboard and database right on the platform, choose Vibe Coding Hosting Pro at an average of NT$999 a month (billed yearly), which includes Roamer AI; new projects use Laravel and MariaDB, and for code you bring in, Roamer AI helps on a best-effort basis without guarantees. Both plans come with 10GB of storage; see Vibe Coding Hosting yearly plans.
Every new purchase can be fully refunded within 30 days of payment, so one deploy and one Verify will tell you whether it works for you. All our Vibe Coding Hosting guides are collected in Vibe Coding Hosting tutorials. The hosting is run by our team in Taiwan, with support in Chinese.
FAQ
Q: Does a LINE bot webhook have to be HTTPS? Can I test with plain http?
It has to be HTTPS. LINE only delivers webhooks to HTTPS URLs with a certificate from a public authority; self-signed certificates won't work. During development you can borrow an HTTPS URL from a tunneling tool, but for production use a host with a fixed URL and certificates that renew themselves. Vibe Coding Hosting handles SSL for the default URL and for a custom domain once it's connected.
Q: Where should the Channel secret and access token go?
In environment variables on the server, read with os.environ or process.env. Keep them out of your code and out of GitHub. On Vibe Coding Hosting you add them in the project page; values are encrypted, AI tools on MCP see only the names, and an uploaded .env file is never deployed. Redeploy after changing them.
Q: My bot calls an AI model and replies slowly. Will LINE give up on it?
It will if you wait for the model before responding. LINE counts no response within 2 seconds as a timeout. Return 200 as soon as the webhook arrives, call the model in the background, then answer with the reply token within its one-minute window. For longer jobs, send a quick "working on it" reply or show LINE's loading animation (5 to 60 seconds, one-on-one chats only), then deliver the result with a push message.
Q: Can I host a Python LINE bot on Vibe Coding Hosting? Flask or FastAPI?
Yes. Python 3.12 and 3.13 are supported, and FastAPI, Flask and Django are detected and started correctly; Node.js 22 and 24 are supported with Express and other frameworks. Your app needs to listen on 0.0.0.0 and the PORT variable. Either framework works, so pick whichever you or your AI prefer.
Q: Can one plan run several LINE bots?
One plan runs one app. If several Official Accounts' bots live in the same codebase on different webhook paths, such as /callback/shop and /callback/clinic, each reading its own Channel secret, they fit in one plan. Separate apps need separate plans.
Sources
- LINE Developers: Build a bot, Receive messages (webhook), Verify webhook signature, Verify webhook URL
- LINE Developers: Check webhook error causes and statistics, Messaging API reference: Send reply message, Messaging API pricing, Display a loading animation
- SDKs: line-bot-sdk-python, line-bot-sdk-nodejs
- Render: Deploy for Free; Zeabur: migration, refund and claims timeline