Installation

From DreamFactory
Jump to: navigation, search
DreamFactoryInstallation

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.

    1. 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.

    1. Bitnami Desktop/Server Installers
      1. 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.

      1. Upgrade

Bitnami installers do not provide a direct method of upgrading, but you can upgrade the DreamFactory code base by using Git and Composer.

        1. 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
        1. 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

If you receive an error indicating that you have uncommitted changes, you can delete the files referenced in the error and then repeat the 'git pull' step.

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

Use the Bitnami DreamFactory Stack Manager to restart your servers.

      1. 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.

    1. 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.

    1. 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/).

    1. IaaS Clouds

You can install DreamFactory on IaaS cloud platforms (Infrastructure as a Service). Follow the instructions for the desired platform.

    1. 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)
    1. 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._

      1. 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.
        1. Linux
  • [CentOS or RedHat](Installation/Linux/Yum)
  • [Mint, Debian or Ubuntu](Installation/Linux/Apt)
        1. 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.
        1. 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.


      1. 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)
      1. 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
      1. 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/
      1. 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...

        1. Nginx
  • [Debian/Mint/Ubuntu](Installation/Linux/Apt)
  • [CentOS/RedHat](Installation/Linux/Yum)
        1. Apache
  • [Debian/Mint/Ubuntu](Installation/Linux/Apt)
  • [CentOS/RedHat](Installation/Linux/Yum)
      1. 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


    1. Additional Drivers
  • [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)