Bonjour Ă tous,
Je cherche de lâaide pour rĂ©soudre une sĂ©rie de problĂšmes dâauthentification OAuth2 avec la connexion pour le TRIGGER Hubspot sur n8n, en version auto-hĂ©bergĂ©e (Docker + Traefik sur VPS Hostinger). Le module dâĂ©criture hubspot fonctionne bien.
Avant dâentreprendre les tests SSH et les nombreux ajustements en terminal, voici ce qui posait problĂšme :
Situation avant interventions Terminal/SSH
- Au lancement de n8n (image officielle via Docker Compose, proxy Traefik), la connexion des credentials Hubspot ne fonctionnait pas.
- Quand je tentais dâajouter un nouveau credential Hubspot dans n8n :
- La fenĂȘtre OAuth2 sâouvrait correctement sur Hubspot
- AprĂšs validation Hubspot, message avec problĂšme dâauth :
- Message âInvalid OAuth2 Stateâ ou âauthorization code not foundâ
- Parfois erreur âredirect_uri mismatchâ
- Aucune credential Hubspot nâĂ©tait enregistrĂ©e ni utilisable.
- Le redirect URI utilisé correspondait à celui conseillé dans la doc n8n (et Hubspot) :
- Jâavais vĂ©rifiĂ© :
- Le paramĂ©trage de lâapplication Hubspot (Client ID & Secret, scopes standard, redirect URI bien prĂ©sent)
- La configuration docker-compose.yml pour les variables dâenvironnement n8n (HOST, PROTOCOL, PORT, WEBHOOK_URLâŠ)
---
Actions tentées en SSH/Terminal
- Recréation complÚte du docker-compose.yml et des containers
- Mise Ă jour Docker Engine et Docker Compose Ă la derniĂšre version stable
- Ajustement Traefik (ports, socket, user, endpointâŠ)
- VĂ©rification/suppression des variables dâenvironnement parasites (DOCKER_HOSTâŠ)
- Purge images, volumes, cache Docker
- Restauration systÚme via snapshot Hostinger pour annuler tous les changements car ça commençait à poser problÚme pour se connecter
- Test de différents navigateurs/machines, suppression de cookies/cache
Infos techniques
- VPS Hostinger, accĂšs root SSH
- Docker Engine 29.0.2, Docker Compose v2.40.3
- Traefik v2/v3 selon essais, n8n docker.n8n.io/n8nio/n8n (derniĂšre version)
- Domaine principal : https://n8n.srv1057437.hstgr.cloud
- Scopes Hubspot : CRM, Workflow, basic contacts/read/write
- Redirect URI testé avec/et sans slash, HTTP et HTTPS
---
Ce que je cherche
- Une méthode fiable et précise pour lier n8n self-hosted à Hubspot via OAuth2
- Un retour dâexpĂ©rience sur les subtilitĂ©s Ă prĂ©voir pour lâauthentification OAuth2 Hubspot sur un environnement Docker/Traefik/Hostinger
- Des logs ou endroits oĂč traquer lâerreur OAuth2 (n8n cĂŽtĂ© serveur, Hubspot, reverse proxyâŠ)
- Toute suggestion sur la configuration, ou pistes documentĂ©es (reverse proxy, scopes, callback, sĂ©curitĂ©, cookiesâŠ)
Merci dâavance pour votre aide.
Thomas
Hello everyone,
Iâm looking for help solving a series of OAuth2 authentication issues with the HubSpot Trigger connection in n8n (self-hosted version using Docker + Traefik on a Hostinger VPS). The HubSpot write module works fine.
Before diving into SSH tests and extensive terminal tweaking, hereâs what the situation looked like:
**Before any Terminal/SSH interventions**
- When launching n8n (official image via Docker Compose with Traefik proxy), HubSpot credentials authentication didnât work.
- When trying to add a new HubSpot credential in n8n:
- The OAuth2 window opened correctly on HubSpot.
- After validating the connection, an authentication error message appeared:
- âInvalid OAuth2 Stateâ or âauthorization code not found.â
- Sometimes âredirect_uri mismatch.â
- No HubSpot credential was recorded or usable.
- The redirect URI used matched the one recommended in the n8n (and HubSpot) documentation:
[https://n8n.srv1057437.hstgr.cloud/rest/oauth2-credential/callback](https://n8n.srv1057437.hstgr.cloud/rest/oauth2-credential/callback
- I had checked:
- The HubSpot app configuration (Client ID & Secret, standard scopes, correct redirect URI)
- The docker-compose.yml configuration for n8n environment variables (HOST, PROTOCOL, PORT, WEBHOOK_URL, etc.)
---
**Actions attempted via SSH/Terminal**
- Complete rebuild of docker-compose.yml and containers
- Updated Docker Engine and Docker Compose to the latest stable version
- Adjusted Traefik configuration (ports, socket, user, endpoint, etc.)
- Checked and removed potential conflicting environment variables (e.g. DOCKER_HOST)
- Purged Docker images, volumes, and cache
- Restored the system via Hostinger snapshot to revert all changes once connectivity became unstable
- Tested different browsers/machines, and cleared cookies/cache
---
**Technical details**
- Hostinger VPS with root SSH access
- Docker Engine 29.0.2, Docker Compose v2.40.3
- Traefik v2/v3 (tested both), n8n docker.n8n.io/n8nio/n8n (latest version)
- Main domain: [https://n8n.srv1057437.hstgr.cloud](https://n8n.srv1057437.hstgr.cloud
- HubSpot scopes: CRM, Workflow, basic contacts/read/write
- Redirect URI tested both with and without trailing slash, and with HTTP and HTTPS
---
**What Iâm looking for**
- A reliable and precise method to connect n8n self-hosted with HubSpot using OAuth2
- Any experience or insights about HubSpot OAuth2 quirks in a Docker/Traefik/Hostinger environment
- Log locations or tips to trace OAuth2 errors (on n8n server side, HubSpot, or reverse proxy)
- Any configuration advice or documented troubleshooting ideas (reverse proxy setup, scopes, callback handling, cookies, security aspects, etc.)
Thanks in advance for your help!





