How To Install CakePHP on Debian 11

Install CakePHP on Debian 11

In this tutorial, we will show you how to install CakePHP on Debian 11. For those of you who didn’t know, CakePHP is a web application development framework written in PHP, built on the concepts of Ruby on Rails. As we know Ruby on Rails uses Ruby as a language but with development features that Cake wanted to implement in PHP. It’s a foundational structure for programmers to create web applications. Models, Views, and Controllers are used for the separation of business logic from data and presentation layers.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo‘ to the commands to get root privileges. I will show you through the step-by-step installation of the CakePHP on a Debian 11 (Bullseye).

Install CakePHP on Debian 11 Bullseye

Step 1. Before we install any software, it’s important to make sure your system is up to date by running the following apt commands in the terminal:

sudo apt update
sudo apt upgrade

Step 2. Installing the LAMP stack.

A Debian 11 LAMP server is required. If you do not have LAMP installed, Please read our previous tutorial to install LAMP Server on Debian 11.

Step 3. Installing Composer.

Now we install Composer using the following command on your Debian system:

curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
chmod +x /usr/local/bin/composer

Step 4. Installing CakePHP on Debian 11.

After installing the composer on your system. Let’s create a CakePHP application named “idroot-app” using the composer command as below:

composer create-project --prefer-dist cakephp/app [project-name]

For example:

composer create-project --prefer-dist cakephp/app [idroot-app]

Next, access it and make executable the bin/cake file that will help us to run the project in developer mode. To do this you have to run:

bin/cake server

Also, you can specify a host and a port to listen on:

bin/cake server -H [host] -p [port]

For example:

bin/cake server -H [192.168.77.21] -p [8080]

Step 5. Accessing CakePHP on Debian.

Once successfully installed, open a web browser and go to https://192.168.77.21:8080 and you will see the following screen starting the installer:

Install CakePHP on Debian 11 Bullseye

Congratulations! You have successfully installed CakePHP. Thanks for using this tutorial for installing the latest version of the CakePHP on Debian 11 Bullseye. For additional help or useful information, we recommend you check the official CakePHP website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!