Skip to content
Follow
Ubuntu Linux

How to Install CakePHP on Ubuntu 24.04

Richard
Written by
Richard
Feb 25, 2025 Updated Aug 13, 2026 3 min read
How to Install CakePHP on Ubuntu 24.04
How to Install CakePHP on Ubuntu 24.04

CakePHP is a free web framework for Ubuntu 24.04 that helps you build websites and web apps much faster. It uses an organized setup to keep your database work, design, and code separate so your projects stay neat and easy to manage.

Before you install CakePHP on Ubuntu 24.04, make sure you have PHP, a web server like Apache, and Composer ready on your system.

⚡ Quick Answer

Install CakePHP by first updating apt and installing composer and PHP extensions. Then, create a project directory and use composer create-project cakephp/app MyApp. Finally, run the built-in server with ./bin/cake server.

Install PHP requirements

The CakePHP installation on Ubuntu 24.04 begins by setting up PHP and its associated tools. The ‘apt’ command installs PHP, Composer, and essential packages like curl, sqlite, xml, and mysql. These installed packages are key for CakePHP to work.

Run the command below to install some essential PHP packages.

🐧Bash / Shell
sudo apt update
sudo apt install composer php8.3-curl php8.3-sqlite3 php8.3-xml php8.3-mysql

Once PHP is installed, open its configuration file. PHP 8.3 is the current version available in Ubuntu 24.04 as of this writing.

🐧Bash / Shell
sudo nano /etc/php/8.3/cli/php.ini

When the file opens, change the highlighted line.

🐘PHP
# line 1614: adjust the value
; Default Value: 1
; Development Value: 1
; Production Value: -1
; https://php.net/zend.assertions

zend.assertions = 1

;
;

Save and exit.

Create CakePHP project

After setting up PHP, the next step to install CakePHP on Ubuntu 24.04 is to create the project folder. Composer then builds the CakePHP application within it, preparing the new web project for active development.

💻Code
mkdir project

Change into the project folder and create the CakePHP app.

Command Prompt
cd project
composer create-project cakephp/app MyApp

Successful execution produces output similar to the example below.

🐘PHP
Permissions set on /home/richard/project/MyApp/tmp/cache
Permissions set on /home/richard/project/MyApp/tmp/cache/models
Permissions set on /home/richard/project/MyApp/tmp/cache/persistent
Permissions set on /home/richard/project/MyApp/tmp/cache/views
Permissions set on /home/richard/project/MyApp/tmp/sessions
Permissions set on /home/richard/project/MyApp/tmp/tests
Permissions set on /home/richard/project/MyApp/tmp
Permissions set on /home/richard/project/MyApp/logs
Updated Security.salt value in config/app_local.php

Change to the MyApp folder and run CakePHP.

Command Prompt
cd MyApp
./bin/cake server -H 0.0.0.0 -p 8765

Open a browser and navigate to the server's hostname or IP address followed by port # 8765.

🐘PHP
Welcome to CakePHP v5.1.6 Console
-------------------------------------------------------------------------------
App : src
Path: /home/richard/project/MyApp/src/
DocumentRoot: /home/richard/project/MyApp/webroot
Ini Path:
-------------------------------------------------------------------------------
built-in server is running in http://0.0.0.0:8765/
You can exit with `CTRL-C`
Install CakePHP on Ubuntu
Install CakePHP on Ubuntu

The development server is now up and running.

Getting CakePHP running on Ubuntu 24.04 comes down to a few core tasks:

  • Install PHP and required packages: Ensure PHP and necessary PHP extensions are installed using the appropriate commands.
  • Configure PHP settings: Modify the PHP configuration file to enable assertions for better error handling.
  • Create a project directory: Set up a dedicated folder for your CakePHP project.
  • Use Composer to create a CakePHP application: Easily generate a new CakePHP application within the project directory.
  • Run the application: Start the CakePHP server and verify it by accessing the designated port in your web browser.

Following these steps efficiently sets up the CakePHP web application on Ubuntu 24.04, allowing concentration to shift entirely to development.

Was this guide helpful?

Was this helpful?
Richard

About the Author

Richard

Tech Writer, IT Professional

Richard, a writer for Geek Rewind, is a tech enthusiast who loves breaking down complex IT topics into simple, easy-to-understand ideas. With years of hands-on experience in system administration and enterprise IT operations, he’s developed a knack for offering practical tips and solutions. Richard aims to make technology more accessible and actionable. He's deeply committed to the Geek Rewind community, always ready to answer questions and engage in discussions.

📚 Related Tutorials

How to Install GNOME Desktop on Ubuntu 24.04
Ubuntu Linux How to Install GNOME Desktop on Ubuntu 24.04
How to Install KDE Desktop on Ubuntu 24.04
Ubuntu Linux How to Install KDE Desktop on Ubuntu 24.04
How to Install PHP Composer on Ubuntu Linux
Ubuntu Linux How to Install PHP Composer on Ubuntu Linux
How to Install PHP on Ubuntu Linux
Ubuntu Linux How to Install PHP on Ubuntu Linux

No comments yet — be the first to share your thoughts!

Leave a Comment

Your email address will not be published. Required fields are marked *