We removed our free Sandbox April 25th.
You can read more on our blog.

Drupal

Note

CLI Command examples on this page are always provided without the --application (shorthand -A) argument, assuming you’re running these commands in a connected folder (at creation or using the dotcloud connect command). For more details on connected folders, see Migrating to the CLI 0.9.

In this tutorial, we will deploy Drupal to dotCloud.

Create a dotcloud.yml file

To deploy to dotCloud, you need to create a file in the root directory of your Drupal deployment called “dotcloud.yml” which describes the structure of your application. For this application, the dotcloud.yml will look like this:

www:
    type: php
mysql:
    type: mysql

Turn off APC during installation

Because APC interferes with the Drupal installation wizard, we’ll need to temporarily disable it. To do this, create a file in the root directory of your Drupal deployment called “php.ini” with the following contents:

apc.enabled=0

Route all requests to the router in index.php

All requests which don’t map to static files should be sent to index.php, which will route them appropriately. To do this, create a file called “nginx.conf” in the root directory of your Drupal deployment with the following contents:

# For Drupal 6 & 7:
try_files $uri $uri/ /index.php?q=$uri&$args;

If you would like to learn more about the try_files directive, please see the Nginx docs

Initialize the database by pushing to dotCloud

Before running the installation wizard, we’ll need to create a Drupal database in our MySQL instance. First, create your application with the flavor of your choice and push to dotCloud by running this command in the root directory of your Drupal deployment (on your local computer):

dotcloud create my_drupal_deployment
dotcloud push

Then connect to mysql and create the database:

dotcloud run mysql -- mysql

In the MySQL prompt that opened, type the following:

CREATE DATABASE drupal;
\q

Install Drupal using the installation wizard

Now you can open the url you saw when you pushed (or run dotcloud url www) and complete the installation wizard. To get the database credentials, run dotcloud info mysql or look at the Environment section in your application dashboard.

Optionally, you can also celebrate the launch of your Drupal app with the beverage of your choice.