User account menu

  • Log in
Dawei Bro

Main navigation

  • Home

Install Drupal Core 11.3.8 on Ubuntu 24.04 with Apache 2 PHP 8.3 PostgreSQL 16

Breadcrumb

  • Home
  • Articles
  • Install Drupal Core 11.3.8 on Ubuntu 24.04 with Apache 2 PHP 8.3 PostgreSQL 16
By daweibro | 10:40 PM CST, Mon April 27, 2026
In my last post, I explained why I decided to roll back from Drupal CMS 2.0 to Drupal Core. While Drupal CMS 2.0 is a fantastic "move-in ready" product, I realized that for my own websites, I prefer the additive development approach. I want to lay every brick myself to avoid the "div soup" and module overhead. Today, I'm uninstalling Drupal CMS 2.0 and setting up a fresh instance of Drupal Core 11.3.8. Since my Ubuntu 24.04 server is already hosting other Drupal sites, the foundation (Apache 2.4.58, PHP 8.3, and PostgreSQL 16) is already rock-solid and optimized. Here is how to deploy a lean, high-performance Drupal 11 site in an existing multi-site environment.

Step 1: Clean Up the Existing Database and Create a Fresh One

Before we start the fresh build, we need to ensure the previous Drupal CMS 2.0 experiment is completely removed. This prevents any configuration drift or lingering database locks. We will remove the old database daweibro, then create it again for the Drupal Core 11 installation.
# Switch to the postgres user
sudo su - postgres

# Remove the old database
dropdb daweibro

# Create a fresh database with the same name and assign the owner
createdb --encoding=UNICODE --owner=daweibroadmin daweibro

# Install the required pg_trgm extension and logout from the postgres user
psql -d daweibro -c "CREATE EXTENSION IF NOT EXISTS pg_trgm;"
exit

Step 2: Clear the Old Files and Fetch the Drupal Core Codebase

It is much safer to remove the entire project directory rather than trying to delete files individually. This ensures no stale vendor libraries or cache folders remain. We will use the drupal/recommended-project template to pull a fresh, clean Drupal Core codebase. Pro-tip: I always run Composer as the www-data user. This ensures that the generated files and folders are immediately owned by the web server. It saves us from having to reset permissions later and completely avoids potential "access denied" errors during runtime.
# Clean out the old installation directory
sudo rm -rf /var/www/html/daweibro.com

cd /var/www/html

# Fetch the latest Drupal Core codebase to the directory ./daweibro.com
# We use 'sudo -u www-data' to ensure correct file ownership from the start
sudo -u www-data composer create-project drupal/recommended-project daweibro.com
This creates the standard Drupal structure, with the /vendor folder safely tucked away above the web root, and /web serving as our public-facing entry point. By running this command as www-data, our web server can immediately write to the sites/default/files and sites/default/settings.php locations, making the subsequent browser installation incredibly smooth.

Step 3: Run the install.php Script via the Browser

Before navigating to your domain, ensure your Apache Virtual Host is correctly configured and your SSL certificates are in place. If you are migrating an existing domain, your Apache configuration should already be pointing to the /web subdirectory of your project root. If this is a new setup, verify that your Virtual Host points to /var/www/html/daweibro.com/web and that you have generated your SSL certificates using Certbot. Once your server is ready, open your browser and go to https://daweibro.com. You will be automatically redirected to https://daweibro.com/core/install.php. Follow the steps in the web installer:
  1. Choose Language: Select English (or your preferred language).
  2. Choose Profile: Select Standard. It provides just enough basic structure (like Article and Basic Page content types) without installing unnecessary modules.
  3. Verify requirements: Drupal will check your PHP environment. Since we are on Ubuntu 24.04 with PHP 8.3, everything should be good to go. If there is a problem on your server, the installer will clearly show you what happened—simply solve the issue and refresh the page.
  4. Set up database
    • Database type: PostgreSQL
    • Database name: daweibro
    • Database username: daweibroadmin
    • Database password: [Your database password]
    • Advanced options:
      • Host: localhost
      • Port number: 5432
      • Table name prefix: (Leave it blank)
  5. Install site: The installer will run through the process of setting up the database tables and configuring the core modules.
  6. Configure site:
    • Site name: Dawei Bro
    • Site email address: [Your Email address]
    • Username: daweibro
    • Password: [Your strong password]
    • Email address: (Same as Site email address)
    • Default time zone: Select your local timezone.
    • Check or uncheck the boxes for update notifications based on your preference.
Congratulations, you have successfully installed Drupal Core! You now have a lean, perfectly structured "bare-shell" ready to be built exactly the way you want it. Welcome back to the true framework experience!
  • Log in to post comments

Footer

  • Privacy Policy
  • Terms of Use
  • Disclaimer

Copyright © 2026 Dawei Bro - All rights reserved