Skip to content

Docker Installation

Quizora ships with a ready-to-use Docker setup for local development, staging, or self-hosted production. Docker runs PHP 8.3, Nginx, MySQL 8, Redis, and a queue worker — no manual PHP or Node.js installation required on your machine.

Prefer the web installer?

If you are deploying to shared hosting (cPanel) or a traditional VPS, use the Installation Guide instead. Docker is optional.


Prerequisites

RequirementVersion
Docker24+
Docker Composev2+ (docker compose command)
RAM1 GB+ recommended
Disk2 GB+ free

What's included

ServiceRole
appPHP-FPM 8.3 — runs Laravel
webNginx — serves public/ on port 8080
mysqlMySQL 8.0 database
redisCache, sessions, and queue driver
queueBackground jobs (payments, emails, certificates)

Frontend assets (Vite) are built automatically inside the Docker image — you do not need Node.js on your host.


Step 1 — Extract the files

  1. Download Quizora from your CodeCanyon account.
  2. Extract the zip and cd into the project root (the folder containing docker-compose.yml).

Step 2 — Review environment config

Quizora includes a Docker-specific environment file: .env.docker.

It is pre-configured with Docker service hostnames:

VariableValueWhy
APP_URLhttp://localhost:8080Matches the Nginx port mapping
DB_HOSTmysqlDocker service name (not 127.0.0.1)
REDIS_HOSTredisDocker service name
CACHE_STOREredisRecommended for Docker
SESSION_DRIVERredisRecommended for Docker
QUEUE_CONNECTIONredisRequired for the queue worker

docker-compose.yml mounts .env.docker into the container as .env (Laravel and Artisan require a file on disk).

.env.docker must exist

Create it from the template if missing: cp .env.example .env.docker then adjust Docker values (DB_HOST=mysql, REDIS_HOST=redis, etc.).

Customising credentials

Database credentials in .env.docker must match docker-compose.yml:

  • Database: quizora
  • Username: quizora
  • Password: secret

Change both files together if you want different passwords.

Platform settings (OpenAI, payments, storage, Google login, and license) are configured in Admin → Settings after install — not in .env.docker.


Step 3 — Build and start

bash
docker compose build
docker compose up -d

Wait until all services are running:

bash
docker compose ps

You should see 5 containers. Example output:

NAME           IMAGE               STATUS          PORTS
quizora-web    nginx:1.27-alpine   Up              0.0.0.0:8080->80/tcp
quizora-app    quizora-app         Up              9000/tcp
quizora-mysql  mysql:8.0           Up (healthy)    0.0.0.0:3306->3306/tcp
quizora-redis  redis:7-alpine      Up              6379/tcp
quizora-queue  quizora-queue       Up              9000/tcp
ContainerExposes host port?Notes
quizora-webYes — 8080Open the app at http://localhost:8080
quizora-mysqlYes — 3306Optional; for local DB tools only
quizora-appNoPHP-FPM (internal, used by Nginx)
quizora-redisNoInternal cache/queue
quizora-queueNoBackground worker

Docker Desktop shows one row with no ports?

Docker Desktop groups Compose projects into a single stack row named quizora. Ports and image names appear as - on that parent row — this is normal.

  1. Click the arrow (›) on the left of the quizora row to expand the stack.
  2. You should see all five containers listed individually.
  3. quizora-web shows port 8080:80; quizora-mysql shows 3306:3306.
  4. app, redis, and queue intentionally have no host ports (they only talk inside the Docker network).

Use Containers → search quizora or run docker compose ps in the terminal for the clearest view.

After changing docker-compose.yml, apply updates with:

bash
docker compose up -d

Step 4 — First-time setup

Generate an application encryption key (writes APP_KEY into .env.docker on your host):

bash
docker compose exec app php artisan key:generate

file_get_contents(.env): No such file

This means the .env mount is missing or .env.docker does not exist on your host. Ensure .env.docker is present, then run docker compose up -d again so the volume mount is applied.

If you get a permission denied error writing .env, run once as root:

bash
docker compose exec -u root app php artisan key:generate

Then choose one of the following:

  1. Open http://localhost:8080/install
  2. Follow the wizard (same as a normal install)
  3. Use these database settings when prompted:
FieldValue
Hostmysql
Port3306
Databasequizora
Usernamequizora
Passwordsecret

Option B — Command line

bash
docker compose exec app php artisan migrate --force
docker compose exec app php artisan db:seed --class=DemoSeeder   # optional demo data

Step 5 — Log in

Open http://localhost:8080 and sign in:

PanelURL
Customer portalhttp://localhost:8080
Creator panelhttp://localhost:8080/creator
Admin panelhttp://localhost:8080/admin

If you used the installer, log in with the admin email and password you set in Step 4.

First login checklist

Go to Admin → Settings and configure your logo, OpenAI key, payment gateways, and email (or keep MAIL_MAILER=log in .env.docker for local testing).


Useful commands

bash
# List containers, ports, and status (best way to verify the stack)
docker compose ps

# View logs
docker compose logs -f app
docker compose logs -f web
docker compose logs -f queue

# Run artisan commands
docker compose exec app php artisan migrate
docker compose exec app php artisan cache:clear

# Stop all containers
docker compose down

# Stop and remove database volumes (fresh start)
docker compose down -v

Updating Quizora

  1. Back up your database and storage/app/ folder.
  2. Pull or replace the application files (keep .env.docker).
  3. Rebuild and restart:
bash
docker compose build
docker compose up -d
docker compose exec app php artisan migrate --force

Rebuilding frontend assets

If you change CSS or JavaScript, rebuild the image. If the browser still shows old styles, remove the public volume and start fresh:

bash
docker compose down
docker volume rm quizora_public_assets   # prefix may vary; run `docker volume ls` to check
docker compose up -d --build

Production notes

The included docker-compose.yml is optimised for local development. For production:

  • Set APP_ENV=production and APP_DEBUG=false in .env.docker
  • Put a reverse proxy (Traefik, Caddy, or cloud load balancer) in front of Nginx with HTTPS
  • Remove the MySQL 3306 port mapping (keep it internal only)
  • Use strong database passwords
  • Add a scheduler container if you use scheduled tasks: php artisan schedule:work
  • Persist storage/app/ (uploads, certificates) via a volume or configure S3 in Admin → Settings → Storage

Troubleshooting

ProblemSolution
Docker Desktop shows one quizora row, ports are -Expand the stack row (›) — see Step 3. Only quizora-web and quizora-mysql expose host ports.
file_get_contents(.env): No such fileCreate .env.docker, then docker compose up -d (mounts it as .env inside containers).
Connection refused to databaseWait for MySQL healthcheck; confirm DB_HOST=mysql in .env.docker
Blank page or 500 errorRun docker compose exec app php artisan key:generate
Queue jobs not processingCheck docker compose logs queue; confirm Redis is running
CSS/JS missingRebuild: docker compose build --no-cache
Port 8080 already in useChange "8080:80" in docker-compose.yml and update APP_URL
Installer Redis warningSafe to ignore — Redis is included in the Docker stack
Changes to docker-compose.yml not appliedRun docker compose up -d (not just restart from Docker Desktop)

File reference

FilePurpose
DockerfileMulti-stage image (PHP extensions + Composer + Vite build + PHP-FPM)
docker-compose.ymlFive services: quizora-app, quizora-web, quizora-mysql, quizora-redis, quizora-queue
docker/nginx/default.confNginx config (includes SSE support for AI streaming)
.env.dockerDocker environment file — mounted as /var/www/html/.env in app and queue
.dockerignoreExcludes vendor/, node_modules/, etc. from the build

For server requirements without Docker, see Requirements.

Quizora v1.2.0 — AI-Powered Quiz Platform