Installation
DreamFactory is free open source software available under the [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0.html).
We provide optional paid support subscriptions for both development and production. More information on support packages is available on DreamFactory's [website](https://www.dreamfactory.com/subscriptions).
There's also a developer forum at [community.dreamfactory.com](http://community.dreamfactory.com). The forum is a good way to ask questions and get help from other developers.
There are many ways to try out and use DreamFactory, documented below.
- Free Hosted Developer Environment
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.
- Bitnami Desktop/Server Installers
- Installation
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.
- [Linux](https://bitnami.com/stack/dreamfactory/installer#linux) (CentOS, Red Hat, Mint, Debian, and Ubuntu desktop and server).
- [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
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
//change this line to your bitnami dreamfactory installation path. //It could be /Applications/dreamfactory-2.0.1-1/apps/dreamfactory or /home/myuser/dreamfactory-2.0.1-1 or /opt/bitnami/apps/dreamfactory // For example: $ cd /Applications/dreamfactory-2.0.1-1/apps/dreamfactory //this is taking a backup just in case $ cp -r htdocs htdocs.old $ cd htdocs //stash only if you have changes you have made to the local install $ 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 --seed $ ../../../php/bin/php artisan cache:clear $ ../../../ctlscript.sh restart
- Windows
This process requires you to have a Windows GIT client with a shell.
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
In your GIT client of choice run:
cd C:\Bitnami\dreamfactory-x.x.x-x\apps\dreamfactory\htdocs git stash git checkout master git pull origin master C:\Bitnami\dreamfactory-x.x.x-x\php\php.exe composer.phar self-update C:\Bitnami\dreamfactory-x.x.x-x\php\php.exe composer.phar install --no-dev C:\Bitnami\dreamfactory-x.x.x-x\php\php.exe artisan migrate --seed C:\Bitnami\dreamfactory-x.x.x-x\php\php.exe artisan cache:clear
On the 'git pull' step you may receive an error indicating that you have uncommitted changes. If you successfully backed up your htdocs folder, you can delete the files referenced in the error and then repeat the 'git pull' step.
Use the Bitnami DreamFactory Stack Manager to restart your servers.
- Troubleshooting
Some upgrades require database schema updates to continue operating correctly. Try the following commands if you run into errors after a software upgrade.
$ php artisan migrate $ php artisan db:seed $ php artisan cache:clear
If you still encounter problems, please contact our [support](DreamFactory/Support) for help.
- Bitnami Virtual Machine
You can download DreamFactory as a [virtual machine](https://bitnami.com/stack/dreamfactory/virtual-machine) for VMware, VirtualBox, or other hypervisor environments.
- 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/).
- IaaS Clouds
You can install DreamFactory on IaaS cloud platforms (Infrastructure as a Service). Follow the instructions for the desired platform.
- [Amazon Web Services (AWS)](https://bitnami.com/stack/dreamfactory/cloud/amazon)
- [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
You can install DreamFactory on PaaS cloud platforms (Platform as a Service). Follow the instructions below.
- [Pivotal Web Services - Coming Soon!](Installation/Pivotal)
- [IBM Bluemix - Coming Soon!](Installation/Bluemix)
- [Red Hat OpenShift](Installation/OpenShift)
- [Heroku - Coming Soon!](Installation/Heroku)
- GitHub
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.
> _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._
- Required Software and Extensions
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.
- PHP 5.5+ - check and install the requirements below for your particular environment.
- Git - see [[1]]
- Composer - see [[2]], may require cURL to be installed from particular environment below.
- Linux
- [CentOS or RedHat](Installation/Linux/Yum)
- [Mint, Debian or Ubuntu](Installation/Linux/Apt)
- Mac OS X
- Install mcrypt library
- 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.
- Windows
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.
- Setup a Database
Install your native database and any additional drivers required for your database.
- [SQLite](Installation/Databases/SQLite)
- [MySQL, MariaDB, or Percona](Installation/Databases/MySQL)
- [PostgreSQL](Installation/Databases/PostgreSQL)
- [Microsoft SQL Server](Installation/Databases/SQLServer)
- [SAP SQL Anywhere](Installation/Databases/SQLAnywhere)
- Switch System Database
If you want to change from one system database to another after you've already run setup/installation:
- Stop Apache
- Edit .env file (in the htdocs folder) to include the right driver, host, and port number. Example:
DB_DRIVER=mysql DB_HOST=localhost DB_DATABASE=dreamfactory DB_USERNAME=dreamfactory DB_PASSWORD=dreamfactory DB_PORT=3306
- In your shell navigate to the dreamfactory root folder (htdocs in Bitnami installs)
- Run these commands:
$ php artisan cache:clear $ php artisan dreamfactory:setup //Answer the on screen prompts
- Restart Apache
- General Instructions
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.
- 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.
$ git clone https://github.com/dreamfactorysoftware/dreamfactory.git ~/df2
- Change your working path to that directory.
$ cd ~/df2
- Install dependencies using composer. For production environment, use --no-dev, otherwise discard that option for a development environment.
$ composer install --no-dev
- 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.
$ php artisan dreamfactory:setup
- Make sure your web server can read/write from/to storage/ (sub directories) and bootstrap/cache/ directories.
Example:
$ sudo chown -R {www user}:{your user group} storage/ bootstrap/cache/ $ sudo chmod -R 2775 storage/ bootstrap/cache/
- Setup a web server
Use PHP's built in web server (**Note**:: Testing only, not for production use)...
$ php artisan serve
Or provision a web server to run your DreamFactory instance by following these instructions...
- Nginx
- [Debian/Mint/Ubuntu](Installation/Linux/Apt)
- [CentOS/RedHat](Installation/Linux/Yum)
- Apache
- [Debian/Mint/Ubuntu](Installation/Linux/Apt)
- [CentOS/RedHat](Installation/Linux/Yum)
- Upgrade
Use git commands to pull the latest code from the dreamfactory repo. For example,
$ git stash $ git checkout master $ git pull origin master //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 --seed $ php artisan cache:clear
- NOTE**
You man encounter an error similar to this one when running the ``migrate`` command.
[ErrorException] file_put_contents(/path/to/your/dreamfactory/storage/framework/cache/........./1de5863c1e661b7ac3710bc 6b11328b8): failed to open stream: No such file or directory
This error is due to incorrect file permissions. If you encounter the error, please perform the following commands. Then jump back to the above instructions repeat, beginning with the ``migrate`` command.
$ sudo chown -R {www user}:{your user group} storage/ bootstrap/cache/ $ sudo chmod -R 2775 storage/ bootstrap/cache/
- Raspberry Pi 2
You can install and configure DreamFactory on Raspberry Pi 2 as an open source IoT gateway. Follow the general instructions [here](Installation/RaspberryPi2).
- Additional Drivers and Modules
- [SQLite](Installation/Databases/SQLite)
- [MySQL, MariaDB, or Percona](Installation/Databases/MySQL)
- [PostgreSQL](Installation/Databases/PostgreSQL)
- [Microsoft SQL Server](Installation/Databases/SQLServer)
- [SAP SQL Anywhere](Installation/Databases/SQLAnywhere)
- [Oracle Database](Installation/Databases/Oracle_DB)
- [IBM DB2](Installation/Databases/IBM_DB2)
- [Mongo DB](Installation/Databases/MongoDB)
- [v8js](Installation/Modules/v8js)