Important Notes

This tutorial walks you through installing a web server stack (LAMP/LEMP) and assumes a more or less blank server. If you have existing resources installed on the server you will need to work around them. For example this tutorial assumes that DreamFactory will be the only/default web app on this server. If you have other sites (virtual hosts) you will need to adjust the configuration accordingly.
In this tutorial we will be using PHP 7.1.
PHP 7.0 is also supported, but is not covered in this document.

Prerequisites

DreamFactory requires certain applications for install and other functionality.

Install git, curl, zip, unzip

$ sudoapt-get installgit curl zipunzip

PHP

These instructions will install PHP 7 with various modules.
DreamFactory requires the mbstring, zip, curl, mongodb, and sqlite3 php modules. Additionally php-fpm is installed if you will be running Nginx as your web server (recommended.) Finally, the mysql php module needs to be installed if you will be using MySQL or MariadDB, which these instructions recommend for the system database. Other database types will require their php modules to be installed for use within DreamFactory. This is covered in the Drivers and Modules section.

Composer

Composer is a PHP dependency manager and is required for installing DreamFactory.
In these instructions, we will assume you are logged in as a user named dfuser. Anywhere you see this username substitute your own.

Make a bin directory in your home directory if it doesn't already exist.

Restart your terminal app (if using Linux with a GUI) or log out and log back in.

Database

You'll need a database for the system to store configuration information. This tutorial will walk you through installing and using MariaDB (a MySQL clone.) Other supported system databases are SQLite, PostgreSQL, and Microsoft SQL (requires a product subscription.) If you intend to use one of these other databases, you can skip this section. When it comes time to install DreamFactory, just give the install the appropriate connection information for your other database (during php artisan df:env.)

MariaDB

Install

Install the server and client from Apt

Please follow the instructions on the MariaDB Website to get the version you want. We recommend at least version 10.2.

Setup

Start MariaDB

$ sudo service mariadb start

Login to the database

$ mysql -u root -p

(use the root password you provided during installation)

Create a database. You can name it whatever you like. Just make sure you save this information. For the example we called it dreamfactory.

CREATEDATABASE dreamfactory;

Create a user with all privileges on that database. You can name the user and password whatever you like. Just make sure you save this information. For the example we used dfadmin for both the user and YOUR_PASSWORD_HERE for the password field.

DreamFactory

Installing DreamFactory involves getting the required code via git and composer and then using the Laravel artisan command to set up the system. In these instructions, we will assume you are logged in as a user named dfuser. Anywhere you see this username substitute your own.

Create a directory for installation and make your user the owner of the directory. This will be the working directory for the remainder of this section.

$ sudomkdir/opt/dreamfactory

$ sudochown-R dfuser /opt/dreamfactory

Navigate to the working directory and use git to clone the dreamfactory repo