Skip to content
Follow
Ubuntu Linux

How to Install CakePHP on Ubuntu 24.04

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

Installing CakePHP on Ubuntu 24.04 lets you build web applications faster using a popular PHP framework.

CakePHP is a free tool that helps developers create websites and web apps more quickly. It uses a design called Model-View-Controller (MVC) to keep code tidy, separating data, the look of the app, and how it works.

This framework also has a handy feature called ORM that simplifies working with databases. Instead of writing complicated SQL code, you can manage your data using simple objects.

Before you begin, make sure PHP, a web server like Apache, and Composer are set up on your Ubuntu 24.04 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 your project. Next, create a new folder for your project and then use Composer to build the CakePHP application within it. This sets up your new web project, ready for you to start developing.

💻Code
mkdir project
⚠️Warning
Change into the project folder and create your CakePHP app.
Command Prompt
cd project
composer create-project cakephp/app MyApp

If everything works, you should see an output similar to the one 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 your 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

That should do it!

In summary, installing CakePHP on Ubuntu 24.04 involves several key steps:

  • 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 your CakePHP web application on Ubuntu 24.04, allowing you to concentrate on 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 *