Installation

From DreamFactory
Jump to: navigation, search
DreamFactoryInstallation
 
(178 intermediate revisions by 11 users not shown)
Line 1: Line 1:
DreamFactory is free open source software available under the [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0.html). We provide an optional paid support package. More information on the support package is available on DreamFactory's [website](https://www.dreamfactory.com/developers/support).  
+
DreamFactory is supported on Linux, Windows, and Mac OS X.
  
There are many ways to try out and use DreamFactory.  
+
Get started with DreamFactory by following the installation instructions below. To get started select an install method and platform below.
  
## Free Hosted Developer Environment
+
== GitHub ==
  
Sign up for a free DreamFactory-hosted developer account at [www.dreamfactory.com](http://www.dreamfactory.com). Your developer environment is hosted by DreamFactory and lets you try out the software. It has all the same capabilities as the installed open source package (except for server-side scripting), but it's for trying out DreamFactory, not for running production applications. It is kept updated with the latest releases and patches.
+
You can install DreamFactory [https://github.com/dreamfactorysoftware/dreamfactory directly from GitHub].  
 +
We have provided platform specific instructions. If your desired platform is not available, you may need to modify the instructions presented herein.
  
## Bitnami Desktop/Server Installers
+
=== Automated Installers ===
  
### Installation
+
Automated installers for CentOS, Debian, Fedora, and Ubuntu are included in the GitHub repository. You can learn more about these installers [https://github.com/dreamfactorysoftware/dreamfactory/tree/master/installers here]. These installers support both DreamFactory OSS and commercial versions.
  
You can download DreamFactory as a simple click-through installer for the following desktop operating systems. Most common extensions and drivers are pre-packaged and available in these installers.
+
=== Required Software and Extensions ===
  
* [Linux](https://bitnami.com/stack/dreamfactory/installer#linux) (CentOS, Red Hat, Mint, Debian, and Ubuntu desktop and server).
+
At a minimum, you will need the following software and extensions installed and enabled on your system in order to successfully clone and install DreamFactory.
* [Mac OS X](https://bitnami.com/stack/dreamfactory/installer#osx).
+
* [Microsoft Windows](https://bitnami.com/stack/dreamfactory/installer#windows) (Windows 7, 8, 10 and Server 2008R2). **Note:** that some features may not be available or may be limited in this environment.
+
  
### Upgrade
+
* PHP 7.4+ - check and install the requirements below for your particular environment.
 +
** [http://php.net/manual/en/migration71.php  PHP Migration guide ]
 +
** PHP required extensions: Curl, MBString, MongoDB, SQLite, and Zip. You may need to install other extensions depending upon DreamFactory usage requirements. If you don't plan on using MongoDB, please remove the <code>df-mongodb</code> requirement from <code>composer.json</code>, or include the <code>--ignore-platform-reqs</code> option when running composer install.
 +
* Git - see https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
 +
* A web server such as NGINX, Apache, or IIS. You may use PHP's built-in server for development purposes.
 +
* One of four databases for storing configuration data: MS SQL Server, MySQL (MariaDB or Percona are also supported), PostgreSQL, or SQLite.
 +
* Composer - see https://getcomposer.org/download/, may require cURL to be installed from particular environment below.
  
Bitnami installers do not provide a direct method of upgrading, but you can upgrade the DreamFactory code base by using Git and Composer. 
 
  
#### Mac OS X and Linux
+
Operating system-specific instructions are available which may be useful if you need assistance satisfying these requirements:
  
<source lang=bash>
+
* Linux
//change this line to your bitnami dreamfactory installation path. For example:
+
** [[DreamFactory/APT|Mint, Debian or Ubuntu]]
$ cd /Applications/dreamfactory-2.0.1-1/apps/dreamfactory
+
** [[DreamFactory/Yum|CentOS and RedHat]]
//this is taking a backup just in case
+
* Mac
$ cp -r htdocs htdocs.old
+
** [[DreamFactory/OSX|Mac OS X 10.11+]]
$ cd htdocs
+
* Windows
//stash only if you have changes you have made to the local install
+
** [[DreamFactory/Installation/Windows|Server 2012, Server 2016, Windows 10]]
$ git stash
+
$ git checkout master
+
$ git pull origin master
+
//self-update is optional, try it if you get an error without it
+
$ ../../../php/bin/php composer.phar self-update
+
$ ../../../php/bin/php composer.phar install --no-dev
+
$ ../../../php/bin/php artisan migrate
+
$ ../../../php/bin/php artisan cache:clear
+
$ ../../../ctlscript.sh restart
+
</source>
+
  
#### Windows
+
=== Installing and Configuring DreamFactory ===
  
This process requires you to have a Windows GIT client with a shell.
+
We strongly recommend using our automated installers. You can learn more about the installer [https://github.com/dreamfactorysoftware/dreamfactory/tree/master/installers here]. If you'd like to install DreamFactory manually, use the instructions provided in this section. Keep in mind these instructions only pertain to installation of the DreamFactory software, and not to the installation of the many additional dependencies. Refer to the operating system-specific instructions found in this wiki for dependency-related details.
 +
 
 +
The commands shown below are primarily for a Linux/Unix-based operating system, but should also work on Windows (directory structure notwithstanding) provided all the required software and extensions are installed.
 +
 
 +
* Clone this repository to a directory on your system. For testing, using a directory under your home directory is easiest (and demonstrated here), otherwise choices like <code>/var/www/</code> or <code>/opt</code> may be preferred.
 +
<source lang=bash>$ git clone https://github.com/dreamfactorysoftware/dreamfactory.git ~/df2</source>
 +
 
 +
* Change your working path to that directory.
 +
 
 +
<source lang=bash>$ cd ~/df2</source>
 +
 
 +
* Install dependencies using Composer. If you're installing DreamFactory for use in a production environment, include the <code>--no-dev</code> option to avoid installing development-specific packages.
 +
 
 +
<source lang=bash>$ composer install --no-dev</source>
  
Copy the folder C:\Bitnami\dreamfactory-x.x.x-x\apps\dreamfactory\htdocs to C:\Bitnami\dreamfactory-x.x.x-x\apps\dreamfactory\htdocs.old
+
* Next, you'll want to run the following two setup-related commands:  
  
In your GIT client of choice run:
 
 
<source lang=bash>
 
<source lang=bash>
C:\path> cd C:\Bitnami\dreamfactory-x.x.x-x\apps\dreamfactory\htdocs
+
$ php artisan df:env
C:\path> git stash
+
$ php artisan df:setup
C:\path> git checkout master
+
C:\path> git pull origin master
+
C:\path> C:\Bitnami\dreamfactory-x.x.x-x\php\php.exe composer.phar self-update
+
C:\path> C:\Bitnami\dreamfactory-x.x.x-x\php\php.exe composer.phar install --no-dev
+
C:\path> C:\Bitnami\dreamfactory-x.x.x-x\php\php.exe artisan migrate
+
C:\path> C:\Bitnami\dreamfactory-x.x.x-x\php\php.exe artisan cache:clear
+
 
</source>
 
</source>
  
Use the Bitnami DreamFactory Stack Manager to restart your servers.
+
* '''Note:''' In earlier versions of DreamFactory this command was named <code>dreamfactory:setup</code> or <code>df:setup</code>. As of DF 2.7.0 the command is changed to <code>df:env</code>
  
### Troubleshooting
+
* Make sure your web server can read/write from/to the DreamFactory application's <code>storage</code> and <code>bootstrap/cache</code> directories. Unix/Linux and OSX users can use the <code>chown</code> and <code>chmod</code> commands to set these permissions:
 
+
Some upgrades require database schema updates to continue operating correctly. Try the following commands if you run into errors after a software upgrade.
+
  
 
<source lang=bash>
 
<source lang=bash>
$ php artisan migrate
+
$ sudo chown -R {www user}:{your user group} storage/ bootstrap/cache/
$ php artisan db:seed
+
$ sudo chmod -R 2775 storage/ bootstrap/cache/
$ php artisan cache:clear
+
 
</source>
 
</source>
  
If you still encounter problems, please contact our [support](DreamFactory/Support) for help.
+
=== Set Up a Web Server ===
  
## Bitnami Virtual Machine
+
If you're just trying out DreamFactory, consider using PHP's built-in web server:
  
You can download DreamFactory as a [virtual machine](https://bitnami.com/stack/dreamfactory/virtual-machine) for VMware, VirtualBox, or other hypervisor environments.
+
<source lang=bash>$ php artisan serve</source>
+
## Docker Image
+
  
You can build your own Docker [image](https://github.com/dreamfactorysoftware/df-docker/) or pull the latest [Docker image from Docker Hub](https://hub.docker.com/r/dreamfactorysoftware/df-docker/).
+
Alternatively, you'll want to provision a web server by following these instructions:
  
## IaaS Clouds
+
==== Nginx ====
  
You can install DreamFactory on IaaS cloud platforms (Infrastructure as a Service). Follow the instructions for the desired platform.
+
* [[DreamFactory/Installation/Linux/Apt#Web_Server|Debian/Mint/Ubuntu]]
 +
* [[DreamFactory/Installation/Linux/Yum#Web_Server|CentOS/RedHat]]
  
* [Amazon Web Services (AWS)](https://bitnami.com/stack/dreamfactory/cloud/amazon) 
+
==== Apache ====
* [Microsoft Azure](https://bitnami.com/stack/dreamfactory/cloud/azure)
+
* [Google Cloud](https://bitnami.com/stack/dreamfactory/cloud/google)
+
* [VMware](https://bitnami.com/stack/dreamfactory/cloud/vmware)
+
* [Digital Ocean](https://bitnami.com/stack/dreamfactory/cloud/digitalocean)
+
* [IBM Cloud]() - Coming Soon.
+
* [Rackspace]()  - Coming Soon.
+
* [Bitnami Cloud Hosting (AWS)](https://bitnami.com/stack/dreamfactory/cloud) 
+
  
## PaaS Clouds
+
* [[DreamFactory/Installation/Linux/Apt#Web_Server|Debian/Mint/Ubuntu]]
 +
* [[DreamFactory/Installation/Linux/Yum#Web_Server|CentOS/RedHat]]
  
You can install DreamFactory on PaaS cloud platforms (Platform as a Service). Follow the instructions below.
+
=== Set Up a Database ===
  
* [Pivotal Web Services]() - Coming Soon.
+
Additional drivers may be required if you plan on REST-enabling a database:
* [IBM Bluemix]() - Coming Soon.
+
* [Red Hat OpenShift]() - Coming Soon.
+
* [Heroku]() - Coming Soon.
+
  
## GitHub
+
* [[DreamFactory/Installation/Databases/SQLite_Installation|SQLite]]
 +
* [[DreamFactory/Installation/Databases/MySQL_Installation|MySQL, MariaDB, or Percona]]
 +
* [[DreamFactory/Installation/Databases/PostgreSQL_Installation|PostgreSQL]]
 +
* [[DreamFactory/Installation/Databases/SQLServer_as_a_System_Database|Microsoft SQL Server]]
 +
* [[DreamFactory/Installation/Databases/SQLAnywhere_Installation|SAP SQL Anywhere]]
  
You can also install DreamFactory [directly from GitHub](https://github.com/dreamfactorysoftware/dreamfactory). Follow the general instructions after taking care of the requirements for your particular environment.
+
==== Switching Your System Database ====
  
> _Note: This quick setup instruction assumes that you are familiar with composer, git and the basics of how to setup a web and database server._
+
Your DreamFactory application manages many configuration details within an underlying database (four of which are supported: MySQL, MS SQL Server, PostgreSQL, and SQLite). If you want to change from one system database to another after you've already run setup/installation:
  
### Required Software and Extensions
+
*Stop your web server
 +
*Edit the <code>.env</code> file found in the DreamFactory application's root directory to define the correct driver, host, and port number. For example:
  
At minimum, you will need the following software and extensions installed and enabled on your system in order to successfully install and run DreamFactory 2.0 from GitHub.
+
<source lang=bash>
 +
DB_CONNECTION=mysql
 +
DB_HOST=localhost
 +
DB_DATABASE=dreamfactory
 +
DB_USERNAME=dreamfactory
 +
DB_PASSWORD=dreamfactory
 +
DB_PORT=3306
 +
</source>
  
* PHP 5.5+ - check and install the requirements below for your particular environment.
+
*In your shell navigate to the DreamFactory application's root directory.
* Git - see [[https://git-scm.com/book/en/v2/Getting-Started-Installing-Git]]
+
*Run these commands:
* Composer - see [[https://getcomposer.org/download/]], may require cURL to be installed from particular environment below.
+
<source lang=bash>
 +
$ php artisan config:clear
 +
$ php artisan cache:clear
 +
$ php artisan df:setup
 +
</source>
 +
*Restart the web server
  
#### Linux
+
== Docker Image ==
  
* [CentOS or RedHat](Installation/Linux/Yum)
+
Two DreamFactory Docker images are available. The official image is maintained by our team and is available from [https://github.com/dreamfactorysoftware/df-docker/ df-docker repo on GitHub]. A second image is maintained by Bitnami, and is available on [https://hub.docker.com/r/dreamfactorysoftware/df-docker/ DockerHub].
* [Mint, Debian or Ubuntu](Installation/Linux/Apt)
+
  
#### Mac OS X
+
If you don't want to use Bitnami, you can still build your own docker image using our [https://github.com/dreamfactorysoftware/df-docker/ df-docker repo on GitHub].
  
* Install mcrypt library
+
== PaaS Clouds ==
* Install v8js library
+
* Using MAMP
+
  
  Using MAMP allows simple stack setup and has some extensions already included, like mcrypt. It does not however include v8js. You can follow the above compile instructions and place the v8js.so file in the desired MAMP PHP extension directory. Also note that MAMP ships with an older version of MySQL (5.5) which does not support some databases options that you may run into, particularly dealing with timestamp fields.
+
You can install DreamFactory on PaaS cloud platforms (Platform as a Service). Follow the instructions below.
  
#### Windows
+
* [[DreamFactory/Installation/OpenShift|Red Hat OpenShift]]
 +
* [[DreamFactory/Installation/DreamFactory_Deployments_with_CloudFoundry|Pivotal using CloudFoundry]]
 +
* [[DreamFactory/Installation/DreamFactory_Deployments_with_CloudFoundry|IBM Bluemix using CloudFoundry]]
  
To date, the best way to install DreamFactory on Windows is to use the Bitnami installer mentioned above. Some have had success running DreamFactory on existing WAMP stacks or even IIS. We don't currently have a set of installable instructions, but will address this in the near future.
+
== Raspberry Pi ==
  
 +
You can install and configure DreamFactory on Raspberry Pi 2 as an open source IoT gateway. Follow the general instructions [[DreamFactory/Installation/RaspberryPi2|here]].
  
### Setup a Database
+
== Additional Drivers and Modules ==
  
Install your native database and any additional drivers required for your database.
+
* [[DreamFactory/Installation/Databases/Apache Cassandra_Installation|Apache Cassandra]]
* [SQLite](Installation/Databases/SQLite)
+
* [[DreamFactory/Installation/Databases/IBM DB2_Features|IBM Db2]]
* [MySQL, MariaDB, or Percona](Installation/Databases/MySQL)
+
* [[DreamFactory/Installation/Databases/SQLServer|Microsoft SQL Server]]
* [PostgreSQL](Installation/Databases/PostgreSQL)
+
* [[DreamFactory/Installation/Databases/MySQL_Installation|MySQL, MariaDB, or Percona]]
* [Microsoft SQL Server](Installation/Databases/SQLServer)
+
* [[DreamFactory/Installation/Databases/MongoDB_Installation|MongoDB]]
* [SAP SQL Anywhere](Installation/Databases/SQLAnywhere)
+
* [[DreamFactory/Installation/Modules/Node.js|Node.js]]
 +
* [[DreamFactory/Installation/Databases/Oracle DB_Installation|Oracle Database]]
 +
* [[DreamFactory/Installation/Databases/PostgreSQL_Installation|PostgreSQL]]
 +
* [[DreamFactory/Installation/Databases/SQLAnywhere_Installation|SAP SQL Anywhere]]
 +
* [[DreamFactory/Installation/Databases/SQLite_Installation|SQLite]]
 +
* [[DreamFactory/Installation/Modules/v8js_Installation|v8js]]
  
### General Instructions
+
== Installing DreamFactory Behind a Proxy ==
  
The commands shown here are primarily for a Linux based OS, but should also work on Windows (directory structure is obviously different) with all the required software and extensions installed.
+
The DreamFactory installers rely upon several package managers to install not only the core platform software but also an array of dependencies critical to both the platform itself and the underlying operating system. In addition to using the Linux operating system's native installer (e.g. apt, yum, etc), examples of required third-party package managers and installation helpers include:
  
* Clone this repository to a directory on your system. For testing, using a directory under your home directory is easiest, otherwise choices like /var/www/ or /opt may be preferred.
+
* [https://curl.se/ curl]
<source lang=bash>$ git clone https://github.com/dreamfactorysoftware/dreamfactory.git ~/df2</source>
+
* [https://pypi.org/project/pip/ pip]
 +
* [https://pear.php.net/manual/en/installation.getting.php pear]
  
* Change your working path to that directory.
+
The installer scripts also reach out to GitHub to clone the DreamFactory OSS version (which can be upgraded to a commercial version as part of the installation process). Therefore, if you're running the server behind a proxy, you'll need to take some additional steps to account for the network restrictions, notably informing each package manager and installation helper of the proxy requirement.
<source lang=bash>$ cd ~/df2</source>
+
  
* Install dependencies using composer. For production environment, use --no-dev, otherwise discard that option for a development environment.
+
=== Configuring curl ===
<source lang=bash>$ composer install --no-dev</source>
+
  
* Run DreamFactory setup command-line wizard. This will set up your configuration and prompt you for things like database settings, first admin user account, etc. It will also allow you make environment settings changes midway and then run it again to complete the setup.
+
Create a file named <code>.curlrc</code> and add the following line to it:
<source lang=bash>$ php artisan dreamfactory:setup</source>
+
  
* Make sure your web server can read/write from/to storage/ (sub directories) and bootstrap/cache/ directories.
+
<source lang=bash>
Example:
+
proxy = 123.456.789:port
 +
</source>
 +
 
 +
=== PECL/PEAR ===
 +
 
 +
Modify the installation script to include this line *after* PEAR and PECL have been installed:
  
 
<source lang=bash>
 
<source lang=bash>
$ sudo chown -R {www user}:{your user group} storage/ bootstrap/cache/
+
pear config-set http_proxy http://123.456.789:port
$ sudo chmod -R 2775 storage/ bootstrap/cache/
+
 
</source>
 
</source>
  
### Setup a web server
+
=== PIP ===
  
Use PHP's built in web server (**Note**:: Testing only, not for production use)...
+
Create the file <code>~/.config/pip/pip.conf</code> and add this to it:
  
<source lang=bash>$ php artisan serve</source>
+
<source lang=bash>
 +
[global]
 +
proxy = http://123.456.789:port
 +
</source>
  
Or provision a web server to run your DreamFactory instance by following these instructions...
+
=== GitHub ===
  
#### Nginx
+
Add the following code to your <code>~/.git/config</code> file:
  
* [Debian/Mint/Ubuntu](Installation/Linux/Apt)
+
<source lang=bash>
* [CentOS/RedHat](Installation/Linux/Yum)
+
[http]
 +
proxy = http://123.456.789:port
 +
</source>
  
#### Apache
+
=== RPM ===
  
* [Debian/Mint/Ubuntu](Installation/Linux/Apt)
+
If your operating system uses the RPM package manager, you'll need to modify <code>rpm</code> statements to include the <code>--httpproxy</code> flag. For example:
* [CentOS/RedHat](Installation/Linux/Yum)
+
  
### Upgrade
+
<source lang=bash>
 +
sudo rpm --httpproxy http://123.456.789:port -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
 +
</source>
  
Use git commands to pull the latest code from the dreamfactory repo. For example,
+
== Troubleshooting ==
 +
 
 +
If you receive the below error please follow these instructions.
  
 
<source lang=bash>
 
<source lang=bash>
$ git stash
+
GitHub API limit (60 calls/hr) is exhausted, could not fetch https://api.github.com/repos/dreamfactorysoftware/df-adldap. Create a GitHub OAuth token to go over the API rate limit. You can also wait until XXXX-XX-XX XX:XX:XX for the rate limit to reset.
$ git checkout master
+
 
$ git pull origin master
+
Head to https://github.com/settings/tokens/new?scopes=repo&description=Composer to retrieve a token. It will be stored in "/root/.composer/auth.json" for future use by Composer.
//self-update is optional, you might get an error without the latest copy of composer
+
$ php composer.phar self-update
+
$ php composer.phar install --no-dev
+
$ php artisan migrate
+
$ php artisan cache:clear
+
 
</source>
 
</source>
  
 +
First you will want to create a GitHub access token like so: https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line
  
## Drivers
+
After creating the access token and applying it via the command line, configure Composer to use your personal access token: https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line
###MS SQL
+
####Windows
+
*Install DreamFactory.
+
*Download and install Microsoft ODBC Driver 11 for SQL Server (if not already installed). Currently this is available [here](http://www.microsoft.com/en-us/download/details.aspx?id=36434). In 32-bit environments, install the x86 package. In 64-bit environments, install the x64 package.
+
*Download and install the appropriate SQL Server Native Client (if not already installed and SQL Server is not hosted on the same machine as DSP). In 32-bit environments, install the x86 package. In 64-bit environments, install the x64 package. Currently the Microsoft SQL Server 2012 Native Client is available [here](http://www.microsoft.com/en-us/download/details.aspx?id=29065), and the Microsoft SQL Server 2008 R2 Native Client is available [here](http://www.microsoft.com/en-us/download/details.aspx?id=16978).
+
*DreamFactory uses PHP PDO drivers for DB connections. Full documentation on PDO_SQLSRV is available [here](http://php.net/manual/en/ref.pdo-sqlsrv.php). You will need to download and extract the Microsoft Drivers for PHP for SQL Server. Currently these are available [here](https://msdn.microsoft.com/en-us/sqlserver/ff657782.aspx).
+
*Copy the DLLs for your version of PHP into your PHP's extensions directory. E.g., for PHP 5.5, the DLLs are php_pdo_sqlsrv_55_ts.dll and php_sqlsrv_55_ts.dll (which were extracted from the download in the third step). (Rare case: if you are integrating with IIS as your web server, use the non-thread-safe DLLs instead (php_pdo_sqlsrv_55_nts.dll and php_sqlsrv_55_nts.dll).)
+
*Enable the copied DLLs in your php.ini file. Using the example DLLs from step #4, you would add the following lines to C:\Bitnami\dreamfactory-2.0.1-1\php\php.ini and save:
+
**```extension=php_pdo_sqlsrv_55_ts.dll```
+
**```extension=php_sqlsrv_55_ts.dll```
+
*Restart your web server to apply these PHP configuration changes.
+

Latest revision as of 07:55, 7 May 2024

DreamFactory is supported on Linux, Windows, and Mac OS X.

Get started with DreamFactory by following the installation instructions below. To get started select an install method and platform below.

GitHub

You can install DreamFactory directly from GitHub. We have provided platform specific instructions. If your desired platform is not available, you may need to modify the instructions presented herein.

Automated Installers

Automated installers for CentOS, Debian, Fedora, and Ubuntu are included in the GitHub repository. You can learn more about these installers here. These installers support both DreamFactory OSS and commercial versions.

Required Software and Extensions

At a minimum, you will need the following software and extensions installed and enabled on your system in order to successfully clone and install DreamFactory.

  • PHP 7.4+ - check and install the requirements below for your particular environment.
    • PHP Migration guide
    • PHP required extensions: Curl, MBString, MongoDB, SQLite, and Zip. You may need to install other extensions depending upon DreamFactory usage requirements. If you don't plan on using MongoDB, please remove the df-mongodb requirement from composer.json, or include the --ignore-platform-reqs option when running composer install.
  • Git - see https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
  • A web server such as NGINX, Apache, or IIS. You may use PHP's built-in server for development purposes.
  • One of four databases for storing configuration data: MS SQL Server, MySQL (MariaDB or Percona are also supported), PostgreSQL, or SQLite.
  • Composer - see https://getcomposer.org/download/, may require cURL to be installed from particular environment below.


Operating system-specific instructions are available which may be useful if you need assistance satisfying these requirements:

Installing and Configuring DreamFactory

We strongly recommend using our automated installers. You can learn more about the installer here. If you'd like to install DreamFactory manually, use the instructions provided in this section. Keep in mind these instructions only pertain to installation of the DreamFactory software, and not to the installation of the many additional dependencies. Refer to the operating system-specific instructions found in this wiki for dependency-related details.

The commands shown below are primarily for a Linux/Unix-based operating system, but should also work on Windows (directory structure notwithstanding) provided all the required software and extensions are installed.

  • Clone this repository to a directory on your system. For testing, using a directory under your home directory is easiest (and demonstrated here), otherwise choices like /var/www/ or /opt may be preferred.
$ git clone https://github.com/dreamfactorysoftware/dreamfactory.git ~/df2
  • Change your working path to that directory.
$ cd ~/df2
  • Install dependencies using Composer. If you're installing DreamFactory for use in a production environment, include the --no-dev option to avoid installing development-specific packages.
$ composer install --no-dev
  • Next, you'll want to run the following two setup-related commands:
$ php artisan df:env
$ php artisan df:setup
  • Note: In earlier versions of DreamFactory this command was named dreamfactory:setup or df:setup. As of DF 2.7.0 the command is changed to df:env
  • Make sure your web server can read/write from/to the DreamFactory application's storage and bootstrap/cache directories. Unix/Linux and OSX users can use the chown and chmod commands to set these permissions:
$ sudo chown -R {www user}:{your user group} storage/ bootstrap/cache/
$ sudo chmod -R 2775 storage/ bootstrap/cache/

Set Up a Web Server

If you're just trying out DreamFactory, consider using PHP's built-in web server:

$ php artisan serve

Alternatively, you'll want to provision a web server by following these instructions:

Nginx

Apache

Set Up a Database

Additional drivers may be required if you plan on REST-enabling a database:

Switching Your System Database

Your DreamFactory application manages many configuration details within an underlying database (four of which are supported: MySQL, MS SQL Server, PostgreSQL, and SQLite). If you want to change from one system database to another after you've already run setup/installation:

  • Stop your web server
  • Edit the .env file found in the DreamFactory application's root directory to define the correct driver, host, and port number. For example:
DB_CONNECTION=mysql
DB_HOST=localhost
DB_DATABASE=dreamfactory
DB_USERNAME=dreamfactory
DB_PASSWORD=dreamfactory
DB_PORT=3306
  • In your shell navigate to the DreamFactory application's root directory.
  • Run these commands:
$ php artisan config:clear
$ php artisan cache:clear
$ php artisan df:setup
  • Restart the web server

Docker Image

Two DreamFactory Docker images are available. The official image is maintained by our team and is available from df-docker repo on GitHub. A second image is maintained by Bitnami, and is available on DockerHub.

If you don't want to use Bitnami, you can still build your own docker image using our df-docker repo on GitHub.

PaaS Clouds

You can install DreamFactory on PaaS cloud platforms (Platform as a Service). Follow the instructions below.

Raspberry Pi

You can install and configure DreamFactory on Raspberry Pi 2 as an open source IoT gateway. Follow the general instructions here.

Additional Drivers and Modules

Installing DreamFactory Behind a Proxy

The DreamFactory installers rely upon several package managers to install not only the core platform software but also an array of dependencies critical to both the platform itself and the underlying operating system. In addition to using the Linux operating system's native installer (e.g. apt, yum, etc), examples of required third-party package managers and installation helpers include:

The installer scripts also reach out to GitHub to clone the DreamFactory OSS version (which can be upgraded to a commercial version as part of the installation process). Therefore, if you're running the server behind a proxy, you'll need to take some additional steps to account for the network restrictions, notably informing each package manager and installation helper of the proxy requirement.

Configuring curl

Create a file named .curlrc and add the following line to it:

proxy = 123.456.789:port

PECL/PEAR

Modify the installation script to include this line *after* PEAR and PECL have been installed:

pear config-set http_proxy http://123.456.789:port

PIP

Create the file ~/.config/pip/pip.conf and add this to it:

[global]
proxy = http://123.456.789:port

GitHub

Add the following code to your ~/.git/config file:

[http]
proxy = http://123.456.789:port

RPM

If your operating system uses the RPM package manager, you'll need to modify rpm statements to include the --httpproxy flag. For example:

sudo rpm --httpproxy http://123.456.789:port -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

Troubleshooting

If you receive the below error please follow these instructions.

GitHub API limit (60 calls/hr) is exhausted, could not fetch https://api.github.com/repos/dreamfactorysoftware/df-adldap. Create a GitHub OAuth token to go over the API rate limit. You can also wait until XXXX-XX-XX XX:XX:XX for the rate limit to reset.
 
Head to https://github.com/settings/tokens/new?scopes=repo&description=Composer to retrieve a token. It will be stored in "/root/.composer/auth.json" for future use by Composer.

First you will want to create a GitHub access token like so: https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line

After creating the access token and applying it via the command line, configure Composer to use your personal access token: https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line