# Telegram WebHook Setup

**URL:** <https://community.n8n.io/t/telegram-webhook-setup/89278>\
**Category:** Questions\
**Created:** [March 17, 2025, 2:03pm UTC](https://community.n8n.io/t/telegram-webhook-setup/89278 "2025-03-17T14:03:38Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jose\_Miguel\_Regales](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jose_miguel_regales/32/59063_2.png) [@Jose\_Miguel\_Regales](https://community.n8n.io/u/Jose_Miguel_Regales)\
**Post date:** [March 17, 2025, 2:03pm UTC](https://community.n8n.io/t/telegram-webhook-setup/89278/1 "2025-03-17T14:03:38Z")

</div>

Hi i’m completly new about this localhosting and automatization.

I being stuck for a while with the setting up of the https for work with Telegram Bots. I have already a https which is [antagora.de](http://antagora.de) and also already coded it in to the docker yml but still not working. I would be extremely gratefull if somebody gave me a hand on this.

 ![grafik](https://europe1.discourse-cdn.com/n8n/original/3X/7/3/73f4fa8a51a315929680e3d7c040962b859bc179.png)

 ![grafik](https://europe1.discourse-cdn.com/n8n/original/3X/7/c/7c3d3a94731a02ea22869e9272e887e5ef894fec.png)

```auto

```

- n8n version:1.80.5
- Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
- Operating system: Window 11

---

<div class="post-metadata">

**Author:** ![Sebas](https://avatars.discourse-cdn.com/v4/letter/s/ccd318/32.png) [@Sebas](https://community.n8n.io/u/Sebas)\
**Post date:** [March 17, 2025, 6:31pm UTC](https://community.n8n.io/t/telegram-webhook-setup/89278/2 "2025-03-17T18:31:04Z")

</div>

Seems like your using localhost as a webhook, which is not https

```auto
http://localhost:5678/webhook/fffb4aa4-ac38-4465-b9b2-9591a7304ae7/webhook 

```

That is because it is a self hosted n8n. My suggestion would be to create a free account with ngrok service [https://ngrok.com/](https://ngrok.com/)

If have been using this commandline to get my n8n running on docker  
There you can see the places where you would use the url provided by ngrok  
In a commanline. you start the service with

( I edited is a bit to remove personal info)

```auto
docker run -itd \
 --name n8n \
 --restart always \
 -p 5678:5678 \
 -e GENERIC_TIMEZONE="Europe/Amsterdam" \
 -e TZ="Europe/Amsterdam" \
 -e WEBHOOK_TUNNEL_URL="<ngrok url>/" \
 -e WEBHOOK_URL="<ngrok url>" \
 -v n8n_data:/home/node/.n8n \
 -v /Users/......../n8n-data/cert:/home/node/.n8n/cert \
docker.n8n.io/n8nio/n8n:latest

```

You start your forwarding with:

```auto
ngrok http http://localhost:5678

```

There you find the forwarding url:

 ![ngrok](https://europe1.discourse-cdn.com/n8n/original/3X/2/3/235e8de95dce12acfa68ed6a5dbe9ab751844dfa.jpeg)

Use this url on the place holders in the commandline or yml file

You can work this out in your YML file.

You will have to let telgram know what webhook to use.  
You will need your telegram token

```auto
https://api.telegram.org/bot[telegram token]/setWebhook/[ngrok forwarding address]

```

> if this solves your problem then please hit the ‘solution’ button

---

<div class="post-metadata">

**Author:** ![Jerry\_Yao](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jerry_yao/32/60679_2.png) [@Jerry\_Yao](https://community.n8n.io/u/Jerry_Yao)\
**Post date:** [April 28, 2025, 11:53am UTC](https://community.n8n.io/t/telegram-webhook-setup/89278/3 "2025-04-28T11:53:35Z")

</div>

> [@Sebas](#):
>
> `<ngrok url>`

what’s the actually?

---

<div class="post-metadata">

**Author:** ![Sebas](https://avatars.discourse-cdn.com/v4/letter/s/ccd318/32.png) [@Sebas](https://community.n8n.io/u/Sebas)\
**Post date:** [April 28, 2025, 12:57pm UTC](https://community.n8n.io/t/telegram-webhook-setup/89278/4 "2025-04-28T12:57:51Z")

</div>

If you have an account with ngrok you can execute an command in the terminal/commandline tool.

> ngrok http [http://localhost:5678](http://localhost:5678)

It will give you the url. (its called forwarding url) and ends with

> .ngrok-free.app

See my previous post.

---

<div class="post-metadata">

**Author:** ![Hossein\_Kurd](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/hossein_kurd/32/88339_2.png) [@Hossein\_Kurd](https://community.n8n.io/u/Hossein_Kurd)\
**Post date:** [June 7, 2025, 11:36am UTC](https://community.n8n.io/t/telegram-webhook-setup/89278/5 "2025-06-07T11:36:51Z")

</div>

> Windows

I made a file “run-n8n.ps1”  
Then edited it:

```auto
# Prompt user for ngrok HTTPS URL
$ngrokUrl = Read-Host "Enter your ngrok HTTPS URL (e.g. https://1234-56-78-90.ngrok-free.app)"

# Strip trailing slash
$ngrokUrl = $ngrokUrl.TrimEnd('/')

# Extract host from URL
$n8nHost = $ngrokUrl -replace '^https://', ''

# Set environment variables for Docker
$envVars = @(
    "--env", "N8N_HOST=$n8nHost",
    "--env", "N8N_PROTOCOL=https",
    "--env", "WEBHOOK_TUNNEL_URL=$ngrokUrl/",
    "--env", "WEBHOOK_URL=$ngrokUrl/",
    "--env", "N8N_RUNNERS_ENABLED=true"
)

# Run Docker container
docker run -it --rm `
    --name n8n `
    -p 5678:5678 `
    -v n8n_data:/home/node/.n8n `
    @envVars `
    docker.n8n.io/n8nio/n8n

```

PowerShell command:  
`./run-n8n.ps1`

Then, I pasted the link of ngrok in the PowerShell by: `ngrok http http://localhost:5678 `

> Linux Ubuntu

I made a file: `run-n8n.sh`

> Do it if required:

`chmod 777 .\run-n8n.sh`

`chmod +x .\run-n8n.sh`

Then edit it

```auto

# Prompt for ngrok HTTPS URL
read -p "Enter your ngrok HTTPS URL (e.g. https://1234-56-78-90.ngrok-free.app): " NGROK_URL

# Strip trailing slash if any
NGROK_URL=${NGROK_URL%/}

# Extract host from URL
N8N_HOST=$(echo "$NGROK_URL" | sed -E 's|https://||')

# Export env vars (optional – mainly for local debugging)
export N8N_HOST="$N8N_HOST"
export N8N_PROTOCOL="https"
export WEBHOOK_TUNNEL_URL="$NGROK_URL/"
export WEBHOOK_URL="$NGROK_URL/"
export N8N_RUNNERS_ENABLED="true"

# Run n8n with Docker
sudo docker run -it --rm \
  --name n8n \
  -p 5678:5678 \
  -v n8n_data:/home/node/.n8n \
  -e N8N_HOST="$N8N_HOST" \
  -e N8N_PROTOCOL="https" \
  -e WEBHOOK_TUNNEL_URL="$WEBHOOK_TUNNEL_URL" \
  -e WEBHOOK_URL="$NGROK_URL" \
  -e N8N_RUNNERS_ENABLED="$N8N_RUNNERS_ENABLED" \
  docker.n8n.io/n8nio/n8n

```

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/system/32/36532_2.png) [@system](https://community.n8n.io/u/system)\
**Post date:** [September 5, 2025, 11:37am UTC](https://community.n8n.io/t/telegram-webhook-setup/89278/6 "2025-09-05T11:37:49Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
