No description
Find a file
2024-12-12 13:23:45 +05:30
LICENSE Initial commit 2024-12-12 09:55:25 +05:30
paperless-install.sh Add paperless-install.sh 2024-12-12 10:26:31 +05:30
README.md Update README.md 2024-12-12 13:23:45 +05:30

📄 Enhanced Paperless-ngx Installation Script

An automated installation and maintenance script for Paperless-ngx with Docker integration and CloudPanel compatibility. This script provides a robust, self-healing installation process with comprehensive error handling and health checks.

🌟 Features

  • Automated Installation: One-command setup of Docker and Paperless-ngx
  • Smart Health Monitoring: Continuous verification of service health
  • Automatic Recovery: Built-in error detection and recovery procedures
  • Backup System: Automatic backup of existing installations before modifications
  • Secure Configuration: Properly isolated Redis and PostgreSQL containers
  • Detailed Logging: Comprehensive logging for troubleshooting
  • CloudPanel Integration: Ready for CloudPanel reverse proxy setup

📋 Prerequisites

  • Ubuntu ONLY 24.04 server
  • Root access or sudo privileges
  • CloudPanel installed (for reverse proxy setup)
  • Domain or subdomain pointed to your server

🚀 Quick Start

  1. Clone the Script:
wget https://git.hhf.technology/hhf/paperless_ngx_cloudpane/paperless-ngx-installer.git
  1. Make the script executable:
chmod +x paperless-install.sh
  1. Run the installation:
sudo ./paperless-install.sh

⚙️ Configuration

The script includes several configurable parameters at the top:

INSTALL_DIR="/docker/paperless-ngx"  # Installation directory
COMPOSE_FILE="${INSTALL_DIR}/docker-compose.yml"  # Docker compose file location
LOG_FILE="/var/log/paperless-install.log"  # Log file location

Environment Variables

Key environment variables in docker-compose.yml:

PAPERLESS_TIME_ZONE: Europe/London
PAPERLESS_OCR_LANGUAGE: eng
PAPERLESS_URL: https://your-domain.com

🔧 CloudPanel Setup

After running the script, configure CloudPanel:

  1. Create new site in CloudPanel
  2. Select "Reverse Proxy" type
  3. Configure with:
  4. Set up SSL certificate

📝 Logging

The script maintains detailed logs at /var/log/paperless-install.log. View logs with:

tail -f /var/log/paperless-install.log

🛠️ Troubleshooting

Common Issues

  1. Container Start Failure
docker logs paperless-ngx-webserver-1
docker compose restart webserver
  1. Database Connection Issues
docker compose logs db
docker compose restart db
  1. Permission Problems
sudo chown -R 1000:1000 /docker/paperless-ngx/consume
sudo chown -R 1000:1000 /docker/paperless-ngx/export

🔄 Updates

Update Paperless-ngx:

cd /docker/paperless-ngx
docker compose pull
docker compose down
docker compose up -d

🔒 Security

The script implements several security measures:

  • Isolated Docker networks for database and Redis
  • Secure default configurations
  • Automatic backup before modifications
  • SSL/TLS support through CloudPanel

📚 Directory Structure

/docker/paperless-ngx/
├── docker-compose.yml
├── consume/
├── export/
├── data/
└── media/

📄 License

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

🙏 Acknowledgments

📞 Support

⚠️ Disclaimer

This script is provided as-is, without any warranties. Always backup your data before running installation scripts.