How to Install CodeIgniter 3.x on Cloudways Servers

First, connect your server through SSH and download the latest version from here using the wget command or upload the .zip file of CodeIgniter via SFTP. In case, you have your project, upload a zip file with all your project files in it.

Unzip the downloaded package and move its contents to your web root folder (public_html) by typing the command “mv CodeIgniter-3.x.x/*.” (replace 3.x.x with the package version).

Then move /application and /system folders from public_html to private_html folder.

Now, you need to edit the index.php file which can be found inside the public_html folder, to update the paths such as:

  • Set $system_path to “../private_html/system

  • Set $application_folder to “../private_html/application”

Open the /private_html/application/config/config.php file with a text editor and set your base URL. If you intend to use encryption or sessions, set your encryption key, and save the file.

If you intend to use a database, open the application/config/database.php file with a text editor and set your database settings.


If you would like to keep your views public, it is also possible to move the views folder out of your application folder and put them in the /public_html folder.

After moving them, open your main /public_html/index.php and set the $view_folder variables, i.e “./myviews“.

One additional measure to take in production environments is to disable PHP error reporting and any other development-only functionality. In CodeIgniter, this can be done by setting the ENVIRONMENT constant, which is described in detail on the security page.

At Cloudways, you can also disable error reporting on your console from the Settings & Packages section under the Server Management area. You can locate the option of Display Error under the Basic tab. Select No and simply save the changes. That’s it!

That’s it! We hope this article was helpful. If you need any help, then feel free to search your query on Cloudways Support Center or contact us via chat (Need a Hand > Send us a Message). Alternatively, you can also create a support ticket.

Did this answer your question?