3
NPM
groales edited this page 2025-12-04 16:52:46 +01:00
This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Despliegue con NPM

Guía para desplegar BookStack con Nginx Proxy Manager.

Requisitos

  • NPM desplegado y accesible
  • Red Docker proxy creada
  • DNS apuntando al servidor

Pasos de Despliegue

1. Desplegar BookStack

En Portainer, crea el stack sin archivo override (solo docker-compose.yml):

Variables de entorno:

APP_KEY=base64:tu_clave_generada
DB_PASSWORD=password_generado
DOMAIN_HOST=bookstack.tudominio.com

Nota: DOMAIN_HOST es necesaria para que APP_URL funcione correctamente (redireccionamientos, CSS, enlaces)

2. Configurar Proxy Host en NPM

  1. Accede a NPM (ej: https://npm.tudominio.com)
  2. Ve a HostsProxy HostsAdd Proxy Host

Pestaña Details

  • Domain Names: bookstack.tudominio.com
  • Scheme: http
  • Forward Hostname / IP: bookstack
  • Forward Port: 80
  • Cache Assets: Activado
  • Block Common Exploits: Activado
  • Websockets Support: Activado

Pestaña SSL

  • SSL Certificate: Request a new SSL Certificate
  • Email: tu@email.com
  • Force SSL: Activado
  • HTTP/2 Support: Activado
  • HSTS Enabled: Activado (opcional)
  1. Save

3. Verificar

  • Accede a https://bookstack.tudominio.com
  • Verifica el certificado SSL (candado verde)
  • Login con admin@admin.com / password
  • Cambia la contraseña inmediatamente

Comparativa Traefik vs NPM

Aspecto Traefik NPM
Configuración Labels en compose UI web
SSL Automático Manual por dominio
Dificultad Media Fácil
Renovación SSL Automática Automática
Multi-dominio Excelente Bueno
Recomendado para Múltiples servicios Pocos servicios

Troubleshooting

Error 502 Bad Gateway

Verificar:

# BookStack corriendo
docker ps | grep bookstack

# BookStack en red proxy
docker inspect bookstack | grep -A 5 Networks

Certificado SSL falla

Soluciones:

  • Verificar DNS apunta correctamente
  • Intentar con DNS Challenge si puertos 80/443 bloqueados
  • Regenerar certificado en NPM UI

Próximos Pasos

  1. Configuración Inicial - Configurar BookStack
  2. Personalización - LDAP, temas
  3. Backup - Automatiza backups