A Deployment Tool for CodeIgniter 3.0

Installs: 1 552

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 22


dev-master / 1.0.x-dev 2018-04-12 13:10 UTC

This package is not auto-updated.

Last update: 2023-06-02 23:22:03 UTC


Latest Stable Version Total Downloads Latest Unstable Version License

This is a fork of Kenjis original package, updated for Deployer 6.1.0

A Deployment Tool for CodeIgniter 3.1.*

You can deploy CodeIgniter with one command.

This is based on Deployer 6.1.0

Folder Structure

└── deploy/
     ├── deploy.php ... config file for Deployer
     ├──  ... script to deploy
     └── logs/


  • PHP 7.0 or later
  • Composer
  • Git
  • SSH
  • Shell


Install this project with Composer:

$ cd /path/to/codeigniter/
$ composer require stef686/codeigniter-deployer:1.0.x@dev --dev

Install deploy folder to your CodeIgniter application folder:

$ php vendor/stef686/codeigniter-deployer/install.php
  • Above command always overwrites exisiting files.
  • You must run it at CodeIgniter project root folder.


Configure deploy/deployer.php.


// Your production server
server('prod', '', 22)
    ->env('branch', 'master')
    ->env('deploy_path', '/var/www/your-codeigniter-app');

See for details.


// Your Git repository
set('repository', '');

You need git command on your servers, and make sure you can git clone on the servers.


Configure Your Servers


See the sample below. In this case, /var/www/your-codeigniter-app is a base folder.

├── current -> /var/www/your-codeigniter-app/releases/20150529181638
└── releases/
     ├── 20150529180505/
     ├── 20150529181203/
     └── 20150529181638/

Each deployment is installed in releases/YYYYMMDDHHMMSS folder.

The current release is your-codeigniter-app/current folder, and it is a symbolic link to releases/20150529181638 folder.

So if you use codeigniter-composer-installer's folder structure, your Apache configuratoin is like this:

DocumentRoot /var/www/your-codeigniter-app/current/public

If you use CodeIgniter as the default folder structure, your Apache configuratoin is like this:

DocumentRoot /var/www/your-codeigniter-app/current


Deployer will try to get write permission with the sudo command, so this command has to be running without prompt password and without tty.

Here is an example of configuration:

Defaults:username !requiretty

username   ALL=(ALL) NOPASSWD: /usr/bin/setfacl

If you don't need sudo for your deployment, you can set in deploy/deployer.php.

set('writable_use_sudo', false);

How to Deploy

$ cd /path/to/codeigniter/
$ cd deploy/
$ sh

Related Projects for CodeIgniter 3.0