Installation Guide

Deploy BacChecker Portal

Complete step-by-step guide to install and configure your institution's verification portal

15 Steps
< 2 Hours
Production Ready

Important

Before proceeding with installation, ensure you have root or sudo access to your server and that all system requirements are met. A failed installation due to missing dependencies can cause data corruption.

System Requirements

Server Requirements

Operating System:Ubuntu 22.04 LTS+ / CentOS 8+ / Debian 11+
Web Server:Nginx 1.18+ or Apache 2.4+
PHP:8.2 or higher
Database:MySQL 8.0+ or MariaDB 10.6+
Node.js:20.x or higher
Composer:2.6 or higher
Redis:6.0+
Git:2.30+

Minimum Hardware

CPU:4 cores (2.5 GHz+)
RAM:8 GB
Storage:100 GB SSD
Network:100 Mbps

Recommended Hardware

CPU:8+ cores (3.0 GHz+)
RAM:16 GB+
Storage:500 GB SSD (RAID)
Network:1 Gbps

Required PHP Extensions

BCMath
Ctype
cURL
DOM
Fileinfo
Filter
Hash
Mbstring
OpenSSL
PCRE
PDO
Session
Tokenizer
XML
GD
Intl
Zip
Redis

Pre-Installation Checklist

Server meets all system requirements
Static IP address configured
Domain name registered and DNS configured
SSL certificate obtained or ready to generate
Database server installed and secured
Redis server installed and running
Required ports open in firewall (80, 443, 3306, 6379)
Root or sudo access to server
Backup solution prepared
Institution details ready (name, branding, etc.)

Installation Steps

Follow these steps in order to deploy your BacChecker portal. Each step includes the exact commands to run.

Estimated Time

Complete installation typically takes 1-2 hours depending on your server speed and internet connection. Make sure you have time to complete all steps without interruption.

Nginx Configuration

Use this configuration for /etc/nginx/sites-available/bacchecker-gov

/etc/nginx/sites-available/bacchecker-govnginx
server {
    listen 80;
    listen [::]:80;
    server_name verify.yourinstitution.gov.gh;
    return 301 https://$server_name$request_uri;
}

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name verify.yourinstitution.gov.gh;
    root /var/www/bacchecker-gov/public;

    # SSL Configuration
    ssl_certificate /etc/letsencrypt/live/verify.yourinstitution.gov.gh/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/verify.yourinstitution.gov.gh/privkey.pem;
    ssl_protocols TLSv1.3 TLSv1.2;
    ssl_ciphers HIGH:!aNULL:!MD5;

    # Security Headers
    add_header X-Frame-Options "SAMEORIGIN" always;
    add_header X-Content-Type-Options "nosniff" always;
    add_header Strict-Transport-Security "max-age=31536000" always;

    index index.php;
    charset utf-8;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location ~ \.php$ {
        fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
        include fastcgi_params;
    }

    location ~ /\.(?!well-known).* {
        deny all;
    }
}

Environment Variables

Configure these variables in your .env file

Security Warning

Never commit your .env file to version control. Use strong, unique passwords for all credentials. Store the .env file securely and restrict access with proper file permissions (chmod 600 .env).
.envenv
APP_NAME="Your Institution Name"
APP_ENV=production
APP_KEY=base64:... # Generated by artisan key:generate
APP_DEBUG=false
APP_URL=https://verify.yourinstitution.gov.gh

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=bacchecker_gov
DB_USERNAME=bacchecker
DB_PASSWORD=your_secure_password

CACHE_STORE=redis
SESSION_DRIVER=redis
QUEUE_CONNECTION=redis

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_MAILER=smtp
MAIL_HOST=your-mail-server
MAIL_PORT=587
MAIL_USERNAME=your-email@institution.gov.gh
MAIL_PASSWORD=your-mail-password
MAIL_ENCRYPTION=tls

# Central Gateway Configuration
GATEWAY_API_URL=https://api.bacchecker.gov.gh/api/v1
GATEWAY_API_KEY=your_api_key_from_gateway
GATEWAY_API_SECRET=your_api_secret_from_gateway

Installation Complete! 🎉

Your BacChecker portal is now installed. Next, complete the 8-step configuration wizard to set up your institution.