No description
Find a file
2024-12-12 22:12:29 +05:30
authentik-install.sh Add authentik-install.sh 2024-12-12 22:07:57 +05:30
LICENSE Initial commit 2024-12-12 22:04:42 +05:30
README.md Update README.md 2024-12-12 22:12:29 +05:30

Authentik Installation Script for CloudPanel Ubuntu 24.04 server ONLY

This repository contains an automated installation script for deploying Authentik Identity Provider alongside CloudPanel. The script handles Docker installation, service configuration, and initial setup, making it easy to get a production-ready Authentik instance up and running.

License: MIT

Features

  • 🔧 Automated Docker installation and configuration
  • 🚀 One-command Authentik deployment
  • 🔒 Automatic secure credential generation
  • 🛡️ Built-in health checks and verification
  • 🔄 Service recovery and redeployment capabilities
  • 📝 Detailed logging
  • 🌐 CloudPanel integration support

Prerequisites

  • Ubuntu 24.04 server ONLY
  • Root/sudo access
  • CloudPanel installed (optional, for reverse proxy setup)
  • Port 9000 and 9443 available

Quick Start

  1. Download the installation script:
wget -O authentik-install.sh wget https://git.hhf.technology/hhf/authentik_ngx_cloudpanel/raw/branch/main/authentik-install.sh
  1. Make the script executable:
chmod +x authentik-install.sh
  1. Run the installation:
sudo ./authentik-install.sh

What the Script Does

  • Checks and installs Docker if necessary
  • Sets up required directories and configurations
  • Generates secure random passwords and tokens
  • Deploys PostgreSQL, Redis, and Authentik services
  • Configures initial admin account
  • Verifies successful installation
  • Provides detailed setup information

Configuration

The script uses the following default configuration:

  • Installation Directory: /docker/authentik
  • PostgreSQL Database: authentik
  • Web Interface Port: 9000
  • HTTPS Port: 9443

To customize the admin email before installation, edit the script:

ADMIN_EMAIL="your-email@example.com"

Directory Structure

/docker/authentik/
├── docker-compose.yml
├── media/
├── certs/
└── custom-templates/

Logging

The script maintains detailed logs at:

/var/log/authentik-install.log

CloudPanel Integration

After installation, you can set up a reverse proxy in CloudPanel:

  1. Create a new site
  2. Choose "Reverse Proxy" type
  3. Point to http://localhost:9000
  4. Set up SSL certificate

Troubleshooting

Common Issues

  1. Services not starting:
cd /docker/authentik
docker compose ps
docker compose logs
  1. Port conflicts:
sudo lsof -i :9000
sudo lsof -i :9443
  1. Lost credentials:
cd /docker/authentik
cat docker-compose.yml

Initial Setup

Access the setup page at:

http://<your-server-IP>:9000/if/flow/initial-setup/

Maintenance

Backups

Back up your Authentik installation:

cd /docker/authentik
docker compose down
tar -czf authentik-backup.tar.gz ./*
docker compose up -d

Updates

Update Authentik to the latest version:

cd /docker/authentik
docker compose pull
docker compose up -d

Security Notes

  • Change default passwords after initial setup
  • Enable 2FA for admin account
  • Regularly update all services
  • Monitor logs for suspicious activity
  • Back up data regularly

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

Support

For issues and support:

  1. Check the troubleshooting guide
  2. Open an issue on the above troubleshooting link.
  3. Visit the Authentik Documentation