Native apt-based web stack for Debian and Ubuntu (x86_64 + arm64). Apache, PHP, MariaDB, and phpMyAdmin — installed, configured, and ready to use.
- Debian or Ubuntu (including WSL2)
- sudo access — phpup installs system packages and writes to
/etc - curl — installed automatically if missing
if ! command -v curl &> /dev/null; then sudo apt install -y curl; fi && source <(curl -fsSL https://raw.githubusercontent.com/DaFa66/phpup/HEAD/phpup.sh)The script auto-detects Linux and uses native apt package management. After launching, press I to install. On subsequent runs the script remembers your setup and goes straight to the dashboard.
phpup on Linux uses apt — the system package manager. No Homebrew, no third-party package managers. The script auto-detects the platform at runtime and installs everything through apt:
| Backend | Package manager | Platforms |
|---|---|---|
| apt | apt-get / dpkg |
Debian, Ubuntu (native + WSL2) |
Why apt, not Homebrew on Linux? Homebrew on Linux ARM64 has poor bottle coverage. Homebrew on Linux is unofficial and fragile for production-grade services. apt is the native package manager with full ARM64 support and reliable package availability.
| Component | apt Package(s) | Config Location |
|---|---|---|
| Apache | apache2 |
/etc/apache2/sites-available/000-default.conf |
| MariaDB | mariadb-server (latest via mariadb.org repo) |
/etc/mysql/mariadb.conf.d/50-server.cnf |
| PHP | php8.x-* versioned packages (via ondrej/php repo) |
/etc/php/{version}/apache2/php.ini |
| phpMyAdmin | Tarball from phpmyadmin.net | /etc/phpmyadmin/conf.d/phpup.php |
phpup adds two external apt repositories for the latest versions:
- ondrej/php — provides PHP 8.2 through latest stable (currently 8.5), kept current by the repo maintainer
- MariaDB.org — provides the latest stable MariaDB series instead of the distro default
Both repos support x86_64 and arm64.
phpup uses standard Linux system paths:
~/phpup/
├── www/ # ← Your websites go here
│ └── phpinfo.php # (auto-created test file)
├── logs/ # Apache access/error logs
└── data_backup/ # (created on delete — MariaDB databases preserved)
System paths (managed by apt):
/etc/apache2/ # Apache configuration
/etc/php/{version}/apache2/php.ini # PHP configuration
/etc/mysql/mariadb.conf.d/ # MariaDB configuration
/etc/phpmyadmin/conf.d/ # phpMyAdmin overrides
/usr/share/phpmyadmin/ # phpMyAdmin web files
/var/lib/mysql/ # MariaDB data directory
~/.config/phpup/config.json # phpup persistent config
- Port 80, bound as root via
systemctl - DocumentRoot set to
~/phpup/wwwwith<Directory>grant - Home directory made world-executable so
www-datacan traverse to~/phpup/www mod_rewriteenabled withAllowOverride All—.htaccessrewrites work out of the box- PHP module loaded via
libapache2-mod-php - phpMyAdmin alias at
/phpmyadmin
- Extensions:
curl,fileinfo,gd,intl,mbstring,mysql,sqlite3,xml,zip,bcmath,bz2— installed as separate apt packages, auto-enabled display_errors = On- Upload limits: 50 MB files, 300s timeout (suitable for phpMyAdmin imports)
- OPCache enabled with JIT
session.gc_maxlifetime = 14400(4 hours, matches phpMyAdmin session timeout)- PHP runs as an Apache module (
mod_php), not PHP-FPM
- Data directory initialized with blank root password
- Auth switched from
unix_sockettomysql_native_passwordso phpMyAdmin can connect over TCP - Error log configured with
[mysqld]group header
- Installed from the official tarball (not the apt package, to avoid
dbconfig-commoncomplications) - conf.d override at
/etc/phpmyadmin/conf.d/phpup.php— survives delete AllowNoPasswordenabled for root login- Version check disabled, 4-hour session timeout
- Template cache directory configured
- Configuration storage database (
pma) with bookmark, history, and designer support
The hidden fu command switches between PHP versions using the ondrej/php repository. Select a version from the numbered list (8.2 → latest stable). The previous PHP stays installed — switching back is another fu.
fu handles:
- Installing the new versioned packages
- Switching the Apache module (
a2dismodold →a2enmodnew) - Switching the CLI default (
update-alternatives --set php) - Re-applying PHP configuration
phpup uses systemctl for service management:
| Dashboard Key | Action |
|---|---|
| R | Restart Apache + MariaDB (systemctl restart) |
| S | Toggle — stops if running, starts if stopped |
Pressing D:
- Backs up MariaDB data to
~/phpup/data_backup/ - Removes packages (
apt remove) — configs in/etcare preserved by apt - Purges runtime state (
/var/lib/apache2,/var/lib/php,/var/lib/phpmyadmin,/var/lib/mysql) - Keeps
~/phpup/www/and~/phpup/data_backup/untouched
On reinstall, configs in /etc are re-applied automatically. MariaDB data is restored from data_backup/.
| Question | Answer |
|---|---|
| Where to put website files? | ~/phpup/www |
| Test your PHP setup? | http://localhost/phpinfo.php |
| Access phpMyAdmin? | http://localhost/phpmyadmin |
| Login to phpMyAdmin? | Username: root / Password: (blank) |
| PHP from terminal? | php available via update-alternatives |
Works out of the box on Ubuntu and Debian under WSL2. The script:
- Auto-configures Apache directory permissions for the home directory (
chmod o+x $HOME) - Adds the
<Directory>grant required when DocumentRoot is outside/var/www - Uses the same apt packages as native Linux
Finding your website: Visit http://localhost in your Windows browser. WSL2 forwards localhost automatically.
Both the ondrej/php and MariaDB.org repositories provide arm64 packages. phpup detects the architecture via uname -m (display only — apt selects the correct architecture automatically from the same repo URLs).
ARM testing is ongoing — feedback welcome.
Apache returns 403 Forbidden:
The home directory may not be world-executable. Run: chmod o+x $HOME
phpMyAdmin login fails with "Access denied for user 'phpmyadmin'":
The dbconfig-common package may have written credentials without creating the user. The latest phpup creates the control user explicitly — re-run the install (press I).
MariaDB fails to start after delete + reinstall:
The data directory may have stale files. phpup purges /var/lib/mysql on delete and re-initialises on install. If you manually deleted without phpup, run:
sudo rm -rf /var/lib/mysql/*
mariadb-install-db --user=mysql --datadir=/var/lib/mysql
sudo systemctl start mariadbPHP version shown in dashboard doesn't match phpinfo():
The Apache module may not have switched. Run fu again — it handles both the CLI alternative (update-alternatives) and the Apache module (a2enmod).
"command not found: curl" on first run:
The Quick Start command already handles this (sudo apt install -y curl). If you downloaded the script directly, install curl first: sudo apt install -y curl
Open an issue or submit a pull request.