v1.0
Docs / Installation

Installation & Docker Setup

This project is fully containerized using Docker, making setup consistent across all environments. Follow this guide to get up and running in minutes.

Table of Contents

  1. Prerequisites
  2. Quick Start
  3. Common Commands
  4. Common Commands
  5. Troubleshooting

1. Prerequisites

Before you begin, ensure you have the following installed:


2. Docker Setup

Goal: Get the full environment (PHP, MySQL, Redis, Nginx) running with a single command.

Step 1: Clone the Repository

git clone https://github.com/your-org/ci4-core-new.git
cd ci4-core-new

Step 2: Environment Setup

Copy the example environment file:

cp .env.example .env

Note: The default settings in .env are pre-configured to work with the Docker containers (database host is mysql, redis host is redis).

Step 3: Start Containers

Run the application in detached mode:

docker-compose up -d --build

This will start:

Step 4: Verify Installation

Visit http://localhost:81 in your browser. You should see the welcome page.


3. Common Commands

Here are the most useful commands for daily development:

Accessing the Container

To run Artisan/Spark commands or Composer, enter the PHP container:

# Enter the PHP container shell
docker-compose exec php bash

# Run Spark commands directly
docker-compose exec php php spark routes
docker-compose exec php php spark migrate

Logs

View logs for all services or a specific one:

# Follow all logs
docker-compose logs -f

# Follow PHP logs only
docker-compose logs -f php

Stopping the App

# Stop containers
docker-compose stop

# Stop and remove containers/networks
docker-compose down

4. Troubleshooting

Port Conflicts

If port 81 or 3306 is already in use, modify docker/env:

NGINX_PORT=8081  # Change to available port

Permission Issues (Linux)

If `writable/` directory is not writable:

docker-compose exec php chown -R www-data:www-data /var/www/html/writable
ESC

Start typing to search the documentation