NOTE: This guide uses /opt/bitnami to refer to the installation directory for the Bitnami Stack. This is the default installation directory for Bitnami Cloud Hosting, Google Cloud Platform and Microsoft Azure servers and for virtual servers. If you're using a native installer and have installed the Bitnami Stack to a different folder, replace /opt/bitnami in the examples below with your actual installation directory.


    The CodeIgniter framework is installed in the frameworks/codeigniter directory in the installation directory. This directory includes an example application. Application configuration files are in the conf/ directory and public files, such as HTML pages, CSS and JavaScript files, images and other media assets are stored in the htdocs/ directory.

    Activation and Testing

    To enable the example application, edit the Apache configuration file at  /opt/bitnami/apache2/conf/bitnami/bitnami-apps-prefix.conf and uncomment the following line

    Include "/opt/bitnami/frameworks/codeigniter/conf/httpd-prefix.conf"

    Then, restart the Apache server.

    $ sudo /opt/bitnami/ restart apache

    You can now verify that the example application is working by visiting its URL using your browser. Select your platform below.

    Bitnami Cloud Hosting

    Access the example application via your browser at http://[server-IP-address]/codeigniter

    Microsoft Azure / Google Cloud Platform

    Access the example application via your browser at http://[server-IP-address]/codeigniter

    Virtual Machine

    Access the example application via your browser at http://[virtual-server-IP-address]/codeigniter

    Native Installer

    Access the example application via your browser at http://localhost/codeigniter (Windows) or http://localhost:8080/codeigniter (Mac OS X and Linux).

    Tabs end

    Here is an example of what you might see:



    Before using the example application, here are a few important points to consider:

    1. To secure your application session, modify the encryption keys in the application/config/config.php file. Ideally, use a key that’s 32 characters or longer in length.

    $config['encryption_key'] = '';

    On Linux, you can use a command like pwgen 32 to generate a 32-character random key. On Windows, you can use a tool like PWGen.

    2. If your application will use a database, edit the database settings in the application/config/database.php.

    $db['default']['hostname'] = 'localhost';
    $db['default']['username'] = 'user';
    $db['default']['password'] = 'pass';
    $db['default']['database'] = 'database_name';
    $db['default']['dbdriver'] = 'mysql';
    $db['default']['port'] = 3306;
    $db['default']['dbprefix'] = '';

    MySQL support is already available by default. If you plan to use PostgreSQL, enable the php_pdo_pgsql extension in the /opt/bitnami/php/etc/php.ini file.


    To obtain access credentials for the MySQL database, use user 'root'. For the MySQL password, follow the steps below:

    Bitnami Cloud Hosting

    Google Cloud Platform

    • Browse to the Bitnami Launchpad for Google Cloud Platform dashboard and sign in if required using your Bitnami account.
    • Select the "Virtual Machines" menu item.
    • Select your Bitnami Stack server from the resulting list.
    • Obtain the password by selecting "Show" under "Credentials".

    Microsoft Azure

    To log in, use default password 'bitnami'.

    Virtual Machine

    To log in, use default password 'bitnami'.

    Native Installer

    The password is the one specified by you during the Bitnami Stack installation process.

    Tabs end

    3. To move the CodeIgniter example application such that it is available at the root URL of the server (without the /codeigniter URL suffix), follow these steps:

    • Edit the /opt/bitnami/frameworks/codeigniter/conf/httpd-prefix.conf file so that it looks like this:
    DocumentRoot "/opt/bitnami/frameworks/codeigniter/htdocs"
    #Alias /codeigniter/ "/opt/bitnami/frameworks/codeigniter/htdocs/"
    #Alias /codeigniter "/opt/bitnami/frameworks/codeigniter/htdocs"
    Include "/opt/bitnami/frameworks/codeigniter/conf/httpd-app.conf"
    • Edit the /opt/bitnami/frameworks/codeigniter/conf/httpd-app.conf file and replace the AllowOverride None directive with the AllowOverride All directive:
    AllowOverride All
    • c. Restart the Apache server:
    $ sudo /opt/bitnami/ restart apache

    You should now be able to access the example application at the root URL of your server.

    Upgrading to CodeIgniter 3.x

    If your Bitnami stack currently uses CodeIgniter 2.x and you would like to upgrade to CodeIgniter 3.x, follow these steps:

    NOTE: The steps below assume that you have already activated the CodeIgniter framework and example application, as described here.
    1. Log in to your server console.
    2. If you are using a native installer only, load the Bitnami environment:
      $ cd /opt/bitnami
      $ ./use_lampstack
    3. Back up the current version of CodeIgniter:
      $ cd /opt/bitnami/frameworks
      $ sudo mv codeigniter codeigniter.old
    4. Download and install the latest version of CodeIgniter (3.0.0 at the time of writing):
      $ cd /opt/bitnami/frameworks
      $ sudo wget
      $ sudo unzip
      $ sudo mv CodeIgniter-3.0.0 codeigniter
    5. Create a demo application:
      $ cd /opt/bitnami/frameworks/codeigniter
      $ sudo composer self-update
      $ sudo composer create-project --prefer-dist codeigniter/app app
    6. Copy the necessary configuration files from the previous CodeIgniter installation:
      $ sudo cp -R /opt/bitnami/frameworks/codeigniter.old/conf /opt/bitnami/frameworks/codeigniter/
      $ cd /opt/bitnami/frameworks/codeigniter
      $ sudo mkdir htdocs
      $ sudo mv index.php user_guide htdocs
    7. Modify the index.php file:
      $ cd /opt/bitnami/frameworks/codeigniter/htdocs
      $ sudo vi index.php
    8. Within the file, update the values of the $system_path and $application_folder variables so they look like this. If you are using a native installer, remember to modify the paths to reflect the location of your stack installation directory:
      $system_path = '/opt/bitnami/frameworks/codeigniter/system';
      $application_folder = '/opt/bitnami/frameworks/codeigniter/application';
    9. Change file ownerships of the CodeIgniter directory:
      $ cd /opt/bitnami/frameworks
      $ sudo chown -R bitnami:root codeigniter

    You should now be able to access the example application and verify that it is using CodeIgniter 3.x, as shown below:


    More Information

    Learn more about developing applications with CodeIgniter at

    Tag page (Edit tags)
    • No tags
    Pages that link here
    Page statistics
    154872 view(s), 15 edit(s) and 10629 character(s)


    You must login to post a comment.

    Attach file