User Tools

Site Tools


public:paperless

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
public:paperless [2025/08/27 13:35] danielpublic:paperless [2025/09/02 02:49] (current) – Inserted missing index.html specification daniel
Line 6: Line 6:
 Install Debian 14 (basic without GUI is sufficient) Install Debian 14 (basic without GUI is sufficient)
  
-As root, install sudo +Referencing [[https://docs.docker.com/engine/install/debian/#install-using-the-repository|docs.docker.com]], install Docker using the apt repository
-  apt install sudo +
- +
-Referencing [[https://docs.docker.com/engine/install/debian/#install-using-the-repository|docs.docker.com]], still as root, install Docker using the apt repository+
  
 Extend Docker authority to a non-privileged user Extend Docker authority to a non-privileged user
Line 16: Line 13:
 Log out and back in Log out and back in
  
-Referencing [[https://docs.paperless-ngx.com/setup/#docker_script|docs.paperless-ngx.com]], as a non-privileged user, fetch the Paperless-NGX Docker image, and spawn a container from it:+Referencing [[https://docs.paperless-ngx.com/setup/#docker_script|docs.paperless-ngx.com]], as a non-privileged user, provision Paperless using the //installation script//:
  
-  * Specify //sqlite// as **Database** +  * **Database:** //sqlite//
-  * Accept default (blank) **URL**+
   * Accept all other defaults   * Accept all other defaults
 +
 +Add to path
 +  export PATH=$PATH:/usr/libexec/docker/cli-plugins
  
 List active containers List active containers
-  /usr/libexec/docker/cli-plugins/docker-compose ls+  docker-compose ls
  
 Stop, start Paperless-NGX container as daemon Stop, start Paperless-NGX container as daemon
-  export PATH=$PATH:/usr/libexec/docker/cli-plugins 
-   
   cd /home/jdoe/paperless-ngx   cd /home/jdoe/paperless-ngx
   docker-compose down   docker-compose down
Line 35: Line 32:
   sudo systemctl stop docker   sudo systemctl stop docker
   sudo systemctl start docker   sudo systemctl start docker
 +
 +===Place Paperless-NGX Behind Apache Reverse Proxy===
 +
 +In /home/jdoe/paperless-ngx/docker-compose.yml, upsert...
 +
 +Under //webserver// > //ports//
 +  "127.0.0.1:8000:8000"
 +  "[::1]:8000:8000"
 +
 +Under //webserver// > //environment//
 +  PAPERLESS_URL: https://mysite.example.com
 +
 +Install, start Apache and certbot
 +  sudo apt install apache2
 +  sudo apt install certbot python3-certbot-apache
 +  sudo systemctl start apache2
 +
 +In /etc/apache2/apache2.conf, below the //<Direcotry /var/www/html>// block, add:
 +  Alias /.well-known/acme-challenge/ "/var/www/letsencrypt/.well-known/acme-challenge/"
 +
 +Install Apache modules
 +  sudo a2enmod proxy proxy_http ssl
 +  sudo systemctl restart apache2
 +
 +Create vhost directories
 +  sudo mkdir -p /var/www/mysite/
 +  sudo mkdir -p /var/www/letsencrypt/.well-known/acme-challenge/
 +
 +Into /var/www/mysite/index.html, write
 +  <html>
 +  <head>
 +    <meta http-equiv="Refresh" content="0; url='https://mysite.example.com/'" />
 +  </head>
 +  <body>
 +    HTTP disabled. Try <a href="https://mysite.example.com/">https://mysite.example.com/</a>
 +  </body>
 +  </html>
 +
 +Discard or comment all lines in /etc/apache2/sites-enabled/000-default.conf
 +
 +Into /etc/apache2/sites-enabled/mysite.conf, upsert
 +  <VirtualHost *:80 [::]:80>
 +    ServerAdmin root@example.de
 +    DocumentRoot /var/www/mysite
 +    ErrorLog ${APACHE_LOG_DIR}/error.log
 +    CustomLog ${APACHE_LOG_DIR}/access.log combined
 +    ServerName mysite.example.com
 +  </VirtualHost>
 +
 +Restart Apache
 +  sudo /usr/sbin/apachectl restart
 +
 +Fetch test, production certificate
 +  sudo certbot certonly --test-cert --webroot -w /var/www/letsencrypt/ --agree-tos -d mysite.example.com
 +  sudo certbot certonly --webroot -w /var/www/letsencrypt/ --agree-tos -d mysite.example.com
 +
 +To /etc/apache2/sites-enabled/mysite.conf, append
 +  <VirtualHost *:443 [::]:443>
 +    ServerAdmin root@example.com
 +    DocumentRoot /var/www/mysite 
 +    ErrorLog ${APACHE_LOG_DIR}/error.log
 +    CustomLog ${APACHE_LOG_DIR}/access.log combined
 +    ServerName mysite.example.com
 +    SSLEngine On
 +    SSLProxyEngine On
 +    ProxyPreserveHost On
 +    ProxyRequests Off
 +    ProxyPass / http://localhost:8000/
 +    ProxyPassReverse / http://localhost:8000/
 +    SSLCertificateFile /etc/letsencrypt/live/mysite.example.com/cert.pem
 +    SSLCertificateKeyFile /etc/letsencrypt/live/mysite.example.com/privkey.pem
 +    SSLCertificateChainFile /etc/letsencrypt/live/mysite.example.com/chain.pem
 +  </VirtualHost>
 +
 +Restart Apache
 +  sudo /usr/sbin/apachectl restart
  
public/paperless.1756301719.txt.gz · Last modified: 2025/08/27 13:35 by daniel

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki