Installation & Configuration
Installing Trongate is refreshingly simple. There are no dependency managers, no build steps, and no scaffolding commands. The framework includes an intelligent Setup Wizard that handles configuration for you.
Before You Begin
Make sure you have the following up and running:
- PHP 8.0 or higher (8.2+ recommended)
- MySQL or MariaDB
- A web server (Apache or Nginx) with URL rewriting enabled
See the Minimum System Requirements page for full details.
1. Get the Framework
The framework lives on GitHub. You can grab it in two ways:
- Download as ZIP — Visit github.com/trongate/trongate-framework, click the green "Code" button, and select "Download ZIP".
- Clone via Git — From your terminal, run:
git clone https://github.com/trongate/trongate-framework.git2. Place the Files in Your Web Root
Move the downloaded files into your web server's document root. If you're running XAMPP, this is typically htdocs. On MAMP it's htdocs, on LAMP it's /var/www/html, and on WAMP it's www. After placing the files, the structure should look like this:
trongate/
↵ config/
↵ engine/
↵ modules/
↵ public/
↵ uploads/
↵ .htaccess
↵ index.php3. Run the Setup Wizard
Navigate to your site's URL in a browser. The Setup Wizard automatically detects that Trongate has not yet been configured and walks you through the process. Here's a 3-minute demonstration:
The wizard guides you through five easy steps:
- Set your base URL — Tell Trongate where your site lives, then update
config.phpwith the code the wizard provides. - Configure the database — Enter your connection details, test them with a click, then update
database.phpwith the code provided. - Create your admin account — Fill in a username and password for your administrator login.
- Set the default module — Choose which module loads when visitors first hit your homepage.
- Finish and clean up — Delete the setup module (it's no longer needed) and head to your homepage. You're done!
There's no obligation to use Trongate with a database. If you would like to run a database-free version of Trongate then manual configuration is recommended.
Manual Configuration (Optional)
If you prefer to configure Trongate by hand, you can edit the configuration files directly:
Base URL
Open config/config.php and set the BASE_URL constant:
<?php
define('BASE_URL', 'http://localhost/trongate/');
define('ENV', 'dev');Warning: Never launch a Trongate application into production with ENV set to 'dev'. In dev mode, the framework may display detailed error messages that could expose sensitive information. For production, always set ENV to 'prod' or 'live'.
Database Configuration (Optional)
If you'd like to have Trongate work with at least one database and you're opting for manual configuration then you'll have to create your database(s) first.
After you've created your database(s), open config/database.php and enter your database connection details. For example:
<?php
$databases = [
'default' => [
'host' => '127.0.0.1',
'port' => '3306',
'user' => 'root',
'password' => '',
'database' => 'trongate'
]
];You can define additional database groups by adding more entries to the $databases array.
For more information about working with multiplate databases, see Working With Multiple Databases for more.
We're continually improving the Trongate documentation. If anything is incorrect, unclear, incomplete, or could be better, we'd genuinely appreciate your input.
Share your thoughts in the Documentation Feedback.