# Requirements

Before installing Krayin please make sure your server meets the following requirements,

# 🖥️ Server configuration

  • SERVER: Apache 2 OR NGINX (NGINX with PHP-FPM recommended)
  • RAM: 3GB or higher
  • PHP: 8.3 or higher
  • Composer: 2.5 or higher

Use the per-OS install guides below to set up each component on your system.

Choose ONE web server — not both

Krayin needs a single web server. Pick either Apache 2 (uses mod_php out of the box) OR NGINX (requires PHP-FPM). You do not need to install both.

Recommended: NGINX + PHP-FPM — better performance and the standard Laravel production stack.

# Install Apache 2

Apache serves PHP via the built-in mod_php module, so no separate process manager is needed.

Official documentation: Apache HTTP Server install guide (opens new window)


    — OR —


    NGINX does not execute PHP itself — it forwards PHP requests to PHP-FPM over a socket. You must install both NGINX and PHP-FPM.

    Official documentation: NGINX install guide (opens new window)

      # Install PHP-FPM (required for NGINX)

      Official documentation: PHP-FPM install manual (opens new window)

        Verify PHP-FPM is running:

        php-fpm -v
        

        After installing PHP-FPM, point NGINX at the FPM socket in your server block (typically unix:/run/php/php8.3-fpm.sock on Ubuntu).

        # Install PHP 8.3 or higher

        Run the php.new (opens new window) installer for your OS. It installs PHP and Composer in a single command, so you can skip the Composer section below.

          Close and reopen your command line once the installer finishes. To upgrade PHP or Composer later, re-run the same command.

          Prefer your package manager?

          You can still install PHP via Homebrew (brew install php) on macOS, or the ondrej/php PPA (opens new window) on Ubuntu — see the PHP installation manual (opens new window). On Windows, download from windows.php.net (opens new window).

          Verify the installed version:

          php -v
          

          # Install Composer 2.5 or higher

          If you installed PHP through php.new (opens new window) above, Composer is already on your PATH — skip to the verification command at the bottom of this section.

          Otherwise, install Composer manually:

            Verify the installed version:

            composer --version
            

            # 🧩 PHP Extensions

            Krayin needs two PHP extensions on top of the defaults:

            Extension Used for
            intl Internationalization — locales, currency and date formatting
            gd Image processing — avatars, thumbnails, uploads

            # 1. Enable for your OS

              # 2. Restart PHP

              Apply the change with the restart command for your stack — see Restart so the changes apply below.

              # 3. Verify

              php -m | grep -E '^(intl|gd)$'
              

              You should see both intl and gd printed. If either is missing, double-check step 1 for your OS.

              # ⚙️ PHP Configuration

              These three php.ini overrides are required — without them the installer fails on memory limits and bulk imports / exports time out. Three steps:

              # 1. Find your php.ini

              php --ini
              

              The path printed next to Loaded Configuration File is the file to edit.

              Using NGINX + PHP-FPM?

              That command shows the CLI php.ini. NGINX uses the FPM one — find it with php-fpm -i | grep "Loaded Configuration File" and apply the same three changes there too.

              # 2. Set these three values

              Open the file in any editor and update:

              memory_limit = 4G
              max_execution_time = 360
              date.timezone = Asia/Kolkata
              
              Setting Why
              memory_limit 4G or higher — needed for composer install and bulk CSV imports
              max_execution_time 360 seconds or higher — lets long imports / exports finish
              date.timezone Your local timezone (full list (opens new window))

              WARNING

              If a line starts with ;, remove the ; so the directive takes effect.

              # 3. Restart so the changes apply

              Run the restart command that matches the web server you installed earlier on this page — NGINX + PHP-FPM or Apache + mod_php. Inside that section, pick the tab for your OS.

              Not sure which one you installed?

              You picked it under Install Apache 2 / Install NGINX above. If you went with the recommended path, you're on NGINX + PHP-FPM.

                # Apache + mod_php

                  Verify the new values are live:

                  php -i | grep -E '^(memory_limit|max_execution_time|date.timezone)'
                  

                  CLI php artisan ... commands pick up the new settings automatically — no restart needed.

                  # 🗄️ Supported Database Servers

                  Krayin supports two database servers: MySQL 8.0.32+ OR MariaDB 11.4 LTS+. Use collation utf8mb4_unicode_ci for proper Unicode / multilingual support.

                  Choose ONE database — not both

                  Krayin connects to a single database server. Pick either MySQL OR MariaDB. Both are fully supported — neither is preferred over the other.

                  Recommended: MySQL 8.0.32+ — the default Laravel database with the widest hosting and tooling support.

                  Set `DB_CONNECTION` to match your database

                  In your .env file, use DB_CONNECTION=mysql for MySQL and DB_CONNECTION=mariadb for MariaDB.

                  Both values will connect to a MariaDB server, but only mariadb makes Laravel use the MariaDB driver and SQL grammar. If you are already running Krayin on MariaDB with DB_CONNECTION=mysql, change it and run php artisan config:clear.

                  Official downloads: dev.mysql.com/downloads (opens new window)


                    — OR —


                    # Install MariaDB 11.4 LTS or higher

                    Use a currently maintained LTS release. MariaDB 11.8 LTS is recommended.

                    Version Support status Use it?
                    10.3 / 10.4 / 10.5 / 10.6 End of life No
                    10.11 LTS Supported until Feb 2028 Works, but short runway
                    11.4 LTS Supported until May 2029 Yes
                    11.8 LTS Supported until June 2028 Yes — recommended
                    12.3 LTS Supported until June 2029 Newest, less widely deployed

                    Older versions are end of life

                    MariaDB 10.6 and everything below it no longer receive security fixes. Earlier versions of this page listed 10.3 as the minimum — that guidance is outdated. Start at 11.4 LTS.

                    Official downloads: mariadb.org/download (opens new window)

                      Verify the installed version:

                      mariadb --version
                      

                      # Create the database

                      Create the database with the collation Krayin expects before running the installer:

                      CREATE DATABASE krayin
                        CHARACTER SET utf8mb4
                        COLLATE utf8mb4_unicode_ci;
                      

                      Moving an existing MySQL database to MariaDB?

                      A plain mysqldump from MySQL 8 will not import. MySQL stamps every table with the utf8mb4_0900_ai_ci collation, which does not exist in MariaDB, so each CREATE TABLE fails. Rewrite it first:

                      sed -i 's/utf8mb4_0900_ai_ci/utf8mb4_unicode_ci/g' krayin.sql
                      

                      Do not plan the move around replication — row-based replication of JSON columns does not work from MySQL to MariaDB.