Installation

Plainpad is a web application that can be installed and run in web servers. Users will be able to reach the application through their web browsers by using an active internet connection, just like visiting a normal website. The installation process is very similar to the one required by the popular PHP framework Laravel.

Server Requirements

  • Apache / Nginx
  • MySQL
  • PHP >= 8.2
  • BCMath PHP Extension
  • cURL PHP Extension
  • Ctype PHP Extension
  • Fileinfo PHP Extension
  • JSON PHP Extension
  • Mbstring PHP Extension
  • OpenSSL PHP Extension
  • PDO PHP Extension
  • Sodium PHP Extension (required to verify signed updates)
  • Tokenizer PHP Extension
  • XML PHP Extension
  • Zip PHP Extension (required for auto-updates)

Tip: Most shared hosting providers already have these extensions enabled. If you're unsure, create a phpinfo.php file with <?php phpinfo(); ?> and open it in your browser to verify.

Steps

Plainpad requires a few steps and minimum configuration for the installation to your server.

  1. Download the latest release archive from the Plainpad GitHub Releases page.
  2. Upload the contents of the zip archive to your server via FTP, SFTP, or SSH.
  3. Make sure the web server is configured to only serve the public directory.
  4. Create an .env file based on the .env.example provided and replace every {...} placeholder ({URL}, {DB_HOST}, {DB_NAME}, {DB_USERNAME}, {DB_PASSWORD}) with your values.
  5. Run php artisan key:generate to create a random application key.
  6. Run php artisan migrate:fresh --seed to set up the database tables and create the initial admin account. Only run this on an empty database: it drops all existing tables.
  7. Open your browser and navigate to your configured domain. Log in with admin@example.org / 12345678 and change the email and password right away in your Profile.

Using the setup form instead

Instead of steps 4 to 6 you can open /setup.php in your browser (for example https://notes.example.com/setup.php) and fill in the form:

  • It needs an empty MySQL database and a database password, then creates the .env file, generates a random application key and sets up the tables.
  • It refuses to install into a database that already contains tables.
  • Once the .env file exists, setup.php returns a 404, so it can't be run again. You can delete the file after installing.
  • Log in with admin@example.org / 12345678 and change the email and password right away.

Web Server Configuration

Apache

If you're using Apache, ensure mod_rewrite is enabled and AllowOverride All is set for the application directory. A sample virtual host configuration:

<VirtualHost *:80>
    ServerName notes.example.com
    DocumentRoot /var/www/plainpad/public

    <Directory /var/www/plainpad/public>
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

Nginx

For Nginx, the root must point at the public directory. There is no index.php: the app shell is index.html and the PHP front controller is api.php:

server {
    listen 80;
    server_name notes.example.com;
    root /var/www/plainpad/public;
    index index.html;

    # Same security headers as the bundled .htaccess sends on Apache
    add_header X-Frame-Options "DENY" always;
    add_header Content-Security-Policy "frame-ancestors 'none'" always;
    add_header X-Content-Type-Options "nosniff" always;
    add_header Referrer-Policy "same-origin" always;

    # Always revalidate the app shell so a reload after an update loads the new version
    location = /index.html {
        add_header Cache-Control "no-cache";
    }

    location / {
        try_files $uri $uri/ /api.php?$query_string;
    }

    location ~ \.php$ {
        fastcgi_pass unix:/run/php/php-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
        include fastcgi_params;
    }
}

Important: Make sure the entire application directory is completely writable by the PHP process so that the auto update feature works properly.

Behind a Reverse Proxy

If Plainpad runs behind a reverse proxy or load balancer, set TRUSTED_PROXIES in .env to the proxy addresses (comma-separated, or * to trust all) so login rate limiting sees the real client IP addresses:

TRUSTED_PROXIES=10.0.0.1,10.0.0.2

Setting File Permissions

After uploading the files, set the correct permissions so that the web server can read and write as needed:

# Set ownership to the web server user (e.g. www-data)
sudo chown -R www-data:www-data /var/www/plainpad

# Set directory permissions
sudo find /var/www/plainpad -type d -exec chmod 755 {} \;

# Set file permissions
sudo find /var/www/plainpad -type f -exec chmod 644 {} \;

# Ensure storage and cache are writable
sudo chmod -R 775 /var/www/plainpad/storage
sudo chmod -R 775 /var/www/plainpad/bootstrap/cache

HTTPS / SSL Configuration

It is strongly recommended to serve Plainpad over HTTPS, and installing Plainpad as an app on a phone or desktop requires it. You can use Let's Encrypt for free SSL certificates:

# Install Certbot (Ubuntu/Debian)
sudo apt install certbot python3-certbot-apache   # for Apache
sudo apt install certbot python3-certbot-nginx     # for Nginx

# Obtain and install certificate
sudo certbot --apache -d notes.example.com         # for Apache
sudo certbot --nginx -d notes.example.com          # for Nginx

Useful Links