{"id":1193,"date":"2026-11-28T09:00:00","date_gmt":"2026-11-28T09:00:00","guid":{"rendered":"https:\/\/vpslake.com\/blog\/?p=1193"},"modified":"2026-11-28T09:00:00","modified_gmt":"2026-11-28T09:00:00","slug":"install-lamp-ubuntu-25-10-mariadb","status":"publish","type":"post","link":"https:\/\/vpslake.com\/blog\/2026\/11\/28\/install-lamp-ubuntu-25-10-mariadb\/","title":{"rendered":"How to Install LAMP Stack with MariaDB on Ubuntu 25.10"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Install LAMP stack with MariaDB on Ubuntu 25.10 and you will have Apache serving HTTP requests, PHP 8.4 processing dynamic pages, and MariaDB ready for application data. The setup takes about ten minutes on a clean VPS, including a firewall and a temporary PHP check.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Ubuntu 25.10 is an interim release and reached end of life on July 9, 2026. Use Ubuntu 26.04 LTS for a new production server; the instructions below are for an existing Questing installation that must be kept running.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n\n<li>A 64-bit Ubuntu 25.10 (Questing Quokka) VPS with at least 1 GB of RAM and 10 GB of free disk space.<\/li>\n\n\n<li>SSH access as <code>root<\/code>, or a normal account with working <code>sudo<\/code> privileges.<\/li>\n\n\n<li>A public IPv4 address and outbound access to the Ubuntu package archive.<\/li>\n\n\n<li>A domain such as <code>YOUR_DOMAIN<\/code> is optional for the initial install, but required for a trusted TLS certificate.<\/li>\n\n\n<li>A <a href=\"https:\/\/vpslake.com\/buy-vps\">VPSLake Linux VPS<\/a> with root access if you need a server for this stack.<\/li>\n\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The commands use <code>sudo<\/code>. If you are logged in as <code>root<\/code>, remove <code>sudo<\/code> from each command. Keep an existing SSH session open while changing firewall rules.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 1: Confirm Questing and refresh its package sources<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Ubuntu 25.10 is archived, so an existing server must use the Ubuntu release archive before APT can find packages. This step also applies the last package set available for Questing; it does not restore security support.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>grep -E '^(PRETTY_NAME|VERSION_ID|VERSION_CODENAME)=' \/etc\/os-release\nuname -m\nif [ -f \/etc\/apt\/sources.list.d\/ubuntu.sources ]; then\n  sudo sed -i -E 's#https?:\/\/[^[:space:]]*ubuntu\/?#http:\/\/old-releases.ubuntu.com\/ubuntu#g' \/etc\/apt\/sources.list.d\/ubuntu.sources\nelse\n  sudo sed -i -E 's#https?:\/\/[^[:space:]]*ubuntu\/?#http:\/\/old-releases.ubuntu.com\/ubuntu#g' \/etc\/apt\/sources.list\nfi\nsudo apt update\nsudo apt full-upgrade -y<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The release check should show <code>VERSION_ID=\"25.10\"<\/code>, codename <code>questing<\/code>, and normally <code>x86_64<\/code> for an AMD64 VPS. Do not replace <code>questing<\/code> with another codename; the archive retains the release-specific package metadata.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>PRETTY_NAME=\"Ubuntu 25.10 (Questing Quokka)\"\nVERSION_ID=\"25.10\"\nVERSION_CODENAME=questing\nx86_64<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If the server has third-party APT sources, disable any that fail during <code>apt update<\/code> before continuing. Do not mix packages from another Ubuntu release.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 2: Install Apache and protect the public ports<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Apache is the web-facing part of LAMP, while UFW keeps inbound access limited to SSH and the two standard web ports.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install -y apache2 apache2-utils curl ufw\nsudo ufw allow OpenSSH\nsudo ufw allow 80\/tcp\nsudo ufw allow 443\/tcp\nsudo ufw --force enable\nsudo systemctl enable --now apache2\nsudo apachectl configtest\nsudo systemctl is-active apache2\nsudo ufw status verbose<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Add the SSH rule before enabling UFW. If SSH uses a custom port, replace the <code>OpenSSH<\/code> rule with <code>sudo ufw allow YOUR_SSH_PORT\/tcp<\/code>, substituting the numeric port from <code>\/etc\/ssh\/sshd_config<\/code> or <code>ss<\/code> output. The checks should show <code>Syntax OK<\/code>, <code>active<\/code>, and an enabled firewall.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Test Apache locally before testing the public address. This separates a web-server problem from DNS, routing, or a provider-level firewall problem.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl -fsSI http:\/\/127.0.0.1\/<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>HTTP\/1.1 200 OK\nContent-Type: text\/html<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You can also open <code>http:\/\/SERVER_IP\/<\/code> from another device. The default Apache page confirms that port 80 is reachable.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 3: Install and secure MariaDB<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">MariaDB holds application data; leaving it on local access means a PHP application can use the database without exposing port 3306 to the Internet.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install -y mariadb-server mariadb-client\nsudo systemctl enable --now mariadb\nsudo systemctl is-active mariadb\nsudo mariadb-secure-installation<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The hardening utility is documented in MariaDB&#8217;s <a href=\"https:\/\/mariadb.com\/docs\/server\/clients-and-utilities\/deployment-tools\/mariadb-secure-installation\" target=\"_blank\" rel=\"noopener\">official <code>mariadb-secure-installation<\/code> reference<\/a>. On a fresh package install, press Enter for an empty current root password when appropriate, remove anonymous accounts, reject remote root login, remove the test database, and reload the privilege tables. Unix-socket authentication for the administrative account is a normal choice.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Create a database and a separate local application account. Replace <code>YOUR_DB_PASSWORD<\/code> with a long, unique password before running the block; do not put the real password in a public web file.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo mariadb &lt;&lt;'SQL'\nCREATE DATABASE lampdb CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;\nCREATE USER 'lampuser'@'localhost' IDENTIFIED BY 'YOUR_DB_PASSWORD';\nGRANT ALL PRIVILEGES ON lampdb.* TO 'lampuser'@'localhost';\nFLUSH PRIVILEGES;\nSQL\nsudo mariadb -e \"SHOW DATABASES LIKE 'lampdb';\"<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The final command should return a row named <code>lampdb<\/code>. Do not add a UFW rule for 3306: an application on this VPS can connect through the local socket or loopback interface.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Database (lampdb)\nlampdb<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 4: Install PHP 8.4-FPM and connect it to Apache<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Ubuntu 25.10&#8217;s native repositories provide the PHP 8.4 package series. PHP-FPM handles PHP through FastCGI, so Apache does not need the older embedded PHP module; the <a href=\"https:\/\/www.php.net\/manual\/en\/install.fpm.php\" target=\"_blank\" rel=\"noopener\">PHP-FPM manual<\/a> describes this process manager.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Install the runtime, the MariaDB driver, and common extensions used by PHP applications.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install -y php8.4-cli php8.4-fpm php8.4-mysql php8.4-curl php8.4-gd php8.4-mbstring php8.4-xml php8.4-zip php8.4-opcache\nphp -v<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The first line should begin with PHP 8.4.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>PHP 8.4.x (cli) (built: ...)<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Enable Apache&#8217;s FastCGI support, load the matching FPM configuration, and start the versioned service at boot.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo a2enmod proxy_fcgi setenvif\nsudo a2enconf php8.4-fpm\nsudo systemctl enable --now php8.4-fpm\nsudo systemctl reload apache2\nsudo systemctl is-active php8.4-fpm<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Create a small endpoint that returns a fixed message rather than revealing PHP settings with <code>phpinfo()<\/code>. Remove it immediately after the request succeeds.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>printf '%s\\n' '&lt;?php echo \"PHP OK\\\\n\"; ?&gt;' | sudo tee \/var\/www\/html\/health.php &gt; \/dev\/null\ncurl -fsS http:\/\/127.0.0.1\/health.php\nsudo rm -f \/var\/www\/html\/health.php<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>PHP OK<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Verify the LAMP stack<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Run the checks together to confirm that Apache, PHP-FPM, and MariaDB are active, enabled for the next boot, and able to serve a PHP request.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl is-active apache2 php8.4-fpm mariadb\nsudo systemctl is-enabled apache2 php8.4-fpm mariadb\nsudo apachectl configtest\nphp -m | grep -E 'mysqli|mysqlnd|PDO|mbstring|xml'\nsudo mariadb -e \"SELECT VERSION();\"\ncurl -fsSI http:\/\/127.0.0.1\/\nsudo ufw status<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Expect three <code>active<\/code> lines, three <code>enabled<\/code> lines, <code>Syntax OK<\/code>, PHP module names, a MariaDB version, an HTTP success response, and <code>Status: active<\/code> from UFW.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>active\nactive\nactive\nenabled\nenabled\nenabled\nSyntax OK\nHTTP\/1.1 200 OK\nStatus: active<\/code><\/pre>\n\n\n\n<aside class=\"vl-element vl-cta-banner\" aria-label=\"Launch your LAMP server\">\n\t<div class=\"vl-cta-banner__content\">\n\t\t<p class=\"vl-cta-banner__eyebrow\">Ubuntu VPS<\/p>\n\t\t<h3 class=\"vl-cta-banner__title\">Launch your LAMP server<\/h3>\n\t\t<p class=\"vl-cta-banner__text\">Get root access for Apache, PHP, and MariaDB on your own server.<\/p>\n\t<\/div>\n\t<a class=\"vl-cta-banner__button\" href=\"\/buy-vps\" aria-label=\"View Linux VPS plans\">View Linux VPS plans<\/a>\n<\/aside>\n\n\n\n<h2 class=\"wp-block-heading\">Troubleshooting<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><code>apt update<\/code> returns 404 or \u201cdoes not have a Release file\u201d<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Questing was moved off the active mirrors after end of life. Repoint only the Ubuntu source URL to the old-release archive and keep the <code>questing<\/code>, <code>questing-updates<\/code>, and <code>questing-security<\/code> suites unchanged.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>if [ -f \/etc\/apt\/sources.list.d\/ubuntu.sources ]; then\n  sudo sed -i -E 's#https?:\/\/[^[:space:]]*ubuntu\/?#http:\/\/old-releases.ubuntu.com\/ubuntu#g' \/etc\/apt\/sources.list.d\/ubuntu.sources\nelse\n  sudo sed -i -E 's#https?:\/\/[^[:space:]]*ubuntu\/?#http:\/\/old-releases.ubuntu.com\/ubuntu#g' \/etc\/apt\/sources.list\nfi\nsudo apt update<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If a separate vendor repository still fails, disable that repository rather than changing Ubuntu&#8217;s codename or adding a PHP PPA.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><code>E: Unable to locate package php8.4-fpm<\/code><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The APT index is stale, the server is not using Questing sources, or the <code>universe<\/code> component is missing. Confirm the release and inspect the package candidate before retrying.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>grep -E '^(VERSION_ID|VERSION_CODENAME)=' \/etc\/os-release\nsudo apt update\napt-cache policy php8.4-fpm\nsudo apt install -y php8.4-fpm<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The policy output should show a candidate from the Questing archive. Do not install a package built for Noble, Plucky, or another release.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Apache returns <code>503 Service Unavailable<\/code> for a PHP URL<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">PHP-FPM may be stopped, or Apache may not have its versioned FastCGI configuration enabled. Check the unit and socket, then reload both services after correcting the first error in the log.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl status php8.4-fpm --no-pager\nsudo journalctl -u php8.4-fpm -n 40 --no-pager\nls -l \/run\/php\/php8.4-fpm.sock\nsudo apachectl configtest\nsudo systemctl restart php8.4-fpm apache2<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Do not expose the FPM socket or port to the network. If the socket is absent, fix the FPM service failure before restarting Apache.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">SSH stops working after UFW is enabled<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The firewall rule did not match the port used by <code>sshd<\/code>. Open <strong>VPS control panel (Virtualizor) \u2192 VNC console<\/strong> from the VPSLake client area, allow the actual port, and keep the current console session open while testing a second SSH connection.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo ss -ltnp | grep ssh\nsudo ufw allow YOUR_SSH_PORT\/tcp\nsudo ufw status numbered<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Replace <code>YOUR_SSH_PORT<\/code> with the numeric listening port. Remove an obsolete broad rule only after the new SSH connection works.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Hardening<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n\n<li>Move this server to Ubuntu 26.04 LTS before production use; an archived 25.10 installation does not receive new security fixes.<\/li>\n\n\n<li>Point <code>YOUR_DOMAIN<\/code> to the VPS, configure an Apache virtual host, and issue a trusted TLS certificate before accepting passwords or personal data.<\/li>\n\n\n<li>Keep MariaDB on local access and port 3306 closed. Back up <code>\/var\/www<\/code> and the database separately.<\/li>\n\n\n<li>Keep SSH key authentication enabled and review the policy with the <a href=\"https:\/\/vpslake.com\/ufw-firewall-generator\">VPSLake UFW firewall generator<\/a>.<\/li>\n\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">FAQ<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Is Ubuntu 25.10 still supported?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">No. Ubuntu 25.10 reached its planned end of life in July 2026, so its packages are available from the archive but no longer receive normal security maintenance. For a new VPS, select Ubuntu 26.04 LTS instead.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Which PHP version should I use on Ubuntu 25.10?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Use the native PHP 8.4 packages and the matching <code>php8.4-fpm<\/code> service. Pinning the FPM configuration to that branch keeps Apache, the socket path, and systemd aligned; adding a third-party repository is unnecessary for this release.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Does a LAMP website need MariaDB port 3306 open?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">No. When Apache, PHP, and MariaDB share one VPS, the application can connect locally. A remote database connection should be an intentional exception restricted to known source addresses and protected with encryption.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Can I run the stack without a domain name?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Yes. Apache can answer on the VPS IP, and the health endpoint can be checked locally. Add the domain later, create the virtual host, and enable TLS after DNS points to the server.<\/p>\n\n\n\n<script type=\"application\/ld+json\">{\"@context\": \"https:\/\/schema.org\", \"@type\": \"FAQPage\", \"mainEntity\": [{\"@type\": \"Question\", \"name\": \"Is Ubuntu 25.10 still supported?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"No. Ubuntu 25.10 reached its planned end of life in July 2026, so its packages are available from the archive but no longer receive normal security maintenance. For a new VPS, select Ubuntu 26.04 LTS instead.\"}}, {\"@type\": \"Question\", \"name\": \"Which PHP version should I use on Ubuntu 25.10?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"Use the native PHP 8.4 packages and the matching `php8.4-fpm` service. Pinning the FPM configuration to that branch keeps Apache, the socket path, and systemd aligned; adding a third-party repository is unnecessary for this release.\"}}, {\"@type\": \"Question\", \"name\": \"Does a LAMP website need MariaDB port 3306 open?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"No. When Apache, PHP, and MariaDB share one VPS, the application can connect locally. A remote database connection should be an intentional exception restricted to known source addresses and protected with encryption.\"}}, {\"@type\": \"Question\", \"name\": \"Can I run the stack without a domain name?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"Yes. Apache can answer on the VPS IP, and the health endpoint can be checked locally. Add the domain later, create the virtual host, and enable TLS after DNS points to the server.\"}}]}<\/script>\n\n","protected":false},"excerpt":{"rendered":"Install LAMP stack with MariaDB on Ubuntu 25.10 using Apache, PHP 8.4-FPM, UFW, and a safe health check for a working, secure VPS in minutes.","protected":false},"author":1,"featured_media":1194,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"csco_singular_sidebar":"","csco_page_header_type":"","csco_page_load_nextpost":"","footnotes":""},"categories":[5,9],"tags":[71,117,73,72,103],"class_list":["post-1193","post","type-post","status-publish","format-standard","has-post-thumbnail","category-guides","category-vps-hosting","tag-apache","tag-lamp-stack","tag-mariadb","tag-php","tag-ubuntu-25-10","cs-entry"],"_links":{"self":[{"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/posts\/1193","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/comments?post=1193"}],"version-history":[{"count":1,"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/posts\/1193\/revisions"}],"predecessor-version":[{"id":4251,"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/posts\/1193\/revisions\/4251"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/media\/1194"}],"wp:attachment":[{"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/media?parent=1193"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/categories?post=1193"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/tags?post=1193"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}