Crescendo Lab

LINE bot hosting · Agent Lab Deploy

Host a LINE bot.
Webhook in one sentence.

No ngrok: say one sentence to your AI tool and Agent Lab builds your bot with a fixed HTTPS webhook URL.

Host a LINE bot freeJump to the Dockerfile

Why here

Most LINE bot problems are the webhook URL.

LINE needs public HTTPS with a valid certificate; Agent Lab has it on deploy.

A fixed HTTPS URL

Publicly trusted, unchanged on restart, so Verify passes once.

Channel secrets out of code

Project secrets read from the environment, never committed to GitHub.

Roll back a bad reply

One action restores the previous release; the webhook URL stays.

A database when you need one

PostgreSQL in the same workspace for users and chat history.

Choosing

Laptop + ngrok vs a VPS vs Agent Lab

The table scrolls sideways.

Three ways to host a LINE bot compared
What matters to youAgent Lab DeployLaptop + ngrokYour own VPS
Webhook URLFixed HTTPSChanges on restart (free plan)Buy a domain, add a certificate
Laptop closedKeeps runningBot stopsKeeps running
CostFree to try; always-on from Pro at US$29/monthFree (URL changes)A few dollars a month plus time
SecretsOn the platformIn a local .envYou manage them
SetupOne sentence to an AI toolRuns, but not for productionSSH, Docker, Nginx, Let's Encrypt

How

Connect → one sentence → secrets → paste the webhook

  1. Connect Agent Lab

    One MCP line in your AI tool, one browser sign-in.

  2. Say one sentence

    The agent creates and builds the app, and names missing secrets.

  3. Enter the channel secrets

    Console › Project › Settings › Secrets: channel secret and access token.

  4. Paste the webhook URL

    Paste https://<name>--<org>.hosting.agentlab.run/webhook into LINE Developers and press Verify.

Copy and go

The Dockerfile and the sentence

Node.js with the official @line/bot-sdk: listen on $PORT, answer /webhook with 200 first.

Dockerfile

Dockerfile

FROM node:22-slim
WORKDIR /app
COPY package*.json ./
RUN npm ci --omit=dev          # @line/bot-sdk, express
COPY . .
USER node
EXPOSE 8080
CMD ["node", "server.js"]

// server.js
// const line = require("@line/bot-sdk");
// const express = require("express");
// const config = { channelSecret: process.env.LINE_CHANNEL_SECRET };
// const client = new line.messagingApi.MessagingApiClient({
//   channelAccessToken: process.env.LINE_CHANNEL_ACCESS_TOKEN });
// const app = express();
// app.post("/webhook", line.middleware(config), async (req, res) => {
//   res.sendStatus(200);   // answer LINE first, then work
//   for (const e of req.body.events) if (e.type === "message")
//     await client.replyMessage({ replyToken: e.replyToken,
//       messages: [{ type: "text", text: e.message.text }] });
// });
// app.listen(process.env.PORT);
  • LINE_CHANNEL_SECRET Basic settings; proves requests are from LINE
  • LINE_CHANNEL_ACCESS_TOKEN Messaging API; to reply and push
  • PORT the port the platform gives
PROMPT

Say this to your AI tool

Read https://app.agentlab.cresclab.com/agent/deploy.md and deploy this LINE bot to Agent Lab with the Dockerfile at agentlab.cresclab.com/en/deploy/line-bot: listen on $PORT, webhook at /webhook. Tell me where in the console to enter LINE_CHANNEL_SECRET and LINE_CHANNEL_ACCESS_TOKEN rather than asking for them in the chat. Give me the webhook URL when the build passes.

FAQ

Before you host a LINE bot

Where should I host a LINE bot? Is there free hosting?
The Free plan runs one size-S LINE bot at no charge, sleeping after 15 idle minutes; to stay on and miss nothing, Pro is US$29 a month before tax.
Do I need ngrok?
No. ngrok is for laptop testing: it stops with the laptop and the free URL changes. On Agent Lab the bot has a fixed HTTPS URL.
How do I set the LINE webhook URL?
Paste https://<name>--<org>.hosting.agentlab.run/webhook into LINE Developers › Messaging API › Webhook settings, turn on Use webhook and press Verify.
Where do the channel secret and access token go?
Console › Project › Settings › Secrets; the code reads LINE_CHANNEL_SECRET and LINE_CHANNEL_ACCESS_TOKEN from the environment, never from source or chat.
Can I connect ChatGPT or Claude for an AI assistant?
Yes. On each message, call OpenAI, Anthropic or Gemini and send a reply message; the API key is another project secret.