---
title: "Drupal setup on Google App Engine · Appnovation"
url: "https://www.appnovation.com/insights/drupal-setup-google-app-engine"
description: "Step-by-step guide to setting up Drupal on Google App Engine, including the Cloud Platform services you'll need."
---

Article

# Drupal setup on Google App Engine

[![](https://cdn.sanity.io/images/ey850001/production/36eb314260fb474cacc1b3a473d7e8402d997898-68x68.png?w=68&auto=format) Appno Blogger Appnovation Coop](/people/appno-blogger.md) Dec 20, 2013  
 5 min read 

![Drupal setup on Google App Engine](https://cdn.sanity.io/images/ey850001/production/f5f860f8f7939491a4a103a9c9146c8c2c1920d1-700x200.jpg?w=1400&auto=format) 

For today's blog entry we've got Drupal going on GAE. GAE is a lot different from a typical environment Drupal runs on. What does this setup entail? For starters, you will need to familiarize yourself with the basic Cloud Platform Services from Google and how they interact to run Drupal. Php is still a new language for GAE and there are certain limitation and constraints that must be worked around to make Drupal work on this platform. More on that later, for now let's cover what Google services are going to be needed.

*   Google App Engine (Php edition - will run the Drupal code)
*   Google Cloud SQL (Mysql db - persistance layer)
*   Google Cloud Storage (file storage)

If you're not familiar with how to do a basic app development and deployment for GAE you'll need to go through the tutorial. Since [Drupal development](/services/drupal-development.md) uses Php you should do that one, however if you've done this before for Python or Java you may choose to skip it.

[https://developers.google.com/appengine/docs/php/gettingstarted/introduction (opens in new window)](https://developers.google.com/appengine/docs/php/gettingstarted/introduction)

**Now on to configuring the base services.**

*   navigate to cloud.google.com and log in.
*   create a project
*   enable billing (there are Free limits for each of the Google services but you will need to provide a valid form of payment in case you exceed the free limits)
*   enable Google Cloud Storage (via cloud.google.com)
*   create a storage bucket
*   download and configure gsutil ([https://developers.google.com/storage/docs/gsutil\_install (opens in new window)](https://developers.google.com/storage/docs/gsutil_install))
*   'gsutil config' and follow instructions. Once you get 'gsutil ls gs://' to work and you see the bucket you created continue to the next step.
*   create a Google SQL Instance (via cloud.google.com)
*   be sure to set the location preferences to '**Follow GAE App**'
*   See '**Access Control'** tab and **request an IP** for your instance
*   set root password
*   set **Authorized Networks** to your home or office IP for testing

At this point you should be able to connect to your cloud mysql instance via the standard mysql command line client.

For help on using a mysql command line client w/ Google see: [https://developers.google.com/cloud-sql/docs/mysql-client (opens in new window)](https://developers.google.com/cloud-sql/docs/mysql-client)

**Setting up Drupal dev environment**

Now on to the Drupal bits. This post ([http://blog.boombatower.com/drupal-integration-module-google-app-engine (opens in new window)](http://blog.boombatower.com/drupal-integration-module-google-app-engine)) by [@boombatower (opens in new window)](https://twitter.com/boombatower), it's a good overview of what needed to be changed in Drupal to make it work on GAE.

To make things easier you can download an entire release that's already been patched and google\_appengine module already packaged. For future Drupal releases you will need to patch the latest code yourself but for our purposes this packaged version will do nicely. [https://github.com/boombatower/drupal-appengine/releases/tag/7.x-appengine-full-1.0 (opens in new window)](https://github.com/boombatower/drupal-appengine/releases/tag/7.x-appengine-full-1.0)

Next we go through almost standard Drupal installation procedures.

Let's say we downloaded and unpackaged the patched Drupal to directory called **drupal\_gae** .

It may be helpful to read and roughly follow this guide (**drupal\_gae/sites/all/modules/google\_appengine/README.txt**) that comes with the google\_appengine module. Some steps were covered above so skip them as needed. Next you need to:

*   create your local db, add a user, set permssions etc.
*   configure your **settings.php** (as per the **google\_appengine/README.txt**)
*   run the AppEngine dev server: **dev\_appserver.py drupal\_gae**
*   navigate to **localhost:8080/install.php**

You may see a PDO/SQL error. Fix it by setting the mysql socket in **drupal\_gae/php.ini** and set the local mysql socket.

**pdo\_mysql.default\_socket=/YOUR-PATH-TO/mysqld.sock** **mysql.default\_socket = /YOUR-PATH-TO/mysqld.sock** **mysqli.default\_socket = /YOUR-PATH-TO/mysqld.sock**

In the same file, also set your default storage bucket.

**google\_app\_engine.allow\_include\_gs\_buckets = "YOUR\_DEFAULT\_GCS\_BUCKET"**

At this point, you should be able:

*   to proceed with normal installation
*   configure the **google\_appengine** **module**

**Deployment to GAE**

Dump mysql and import it on your GCS. Standard command line interface is the simplest here.

*   **mysqldump -uroot -pYOURPASS drupal\_gae1 >drupal\_gae1.local.sql**
*   **mysql --host=CLOUDSQL-IP --user=root --password=YOURPASS drupal\_gae1 \<drupal\_gae1.local.sql**
*   Create a new non-root user for your Drupal installation on your Cloud SQL instanct
*   give it full permissions for your drupal db and execute '**flush privileges**' in mysql
*   update the appropriate section of settings.php (you'll need db username, password and unix\_socket for your cloud sql instance)
*   Edit **app.yaml** and change '**application: drupal**' to '**application: YOUR-APP-ID**'

At this point you should be ready to upload your full Drupal installation to GAE.

run **appcfg.py update ./gae\_drupal**

Now go to **YOUR-APP-ID.appspot.com** and see if your Drupal site comes up. You may see an error similar to this PDOException: SQLSTATE\[HY000\] \[1045\] user 'YOUR-DB-USERID'@'localhost' .... in lock\_may\_be\_available()

You will be able to connect to your instance with a standard mysql client using root and YOUR-DB-PASSWD but when Drupal tries to connect from GAE it fails with this error. At first glance you may not see anything wrong with your mysql.user table but there is. This is a straight permissions issue as it turns out.

*   make sure all the permissions are granted for **'YOUR-DB-USERID'@'localhost'**.
*   make sure the **PASSWORD IS SET** for **'YOUR-DB-USERID'@'localhost'**

You can use your root mysql login to achieve this. Be sure to **'flush privileges'** when you're done. At this point, refresh your site. You should see the standard Drupal homepage.

I should also mention that Google provides Push-to-Deploy functionality but unfortunately I didn't get a chance to play with it yet. You can read more about it here: [https://developers.google.com/appengine/docs/push-to-deploy (opens in new window)](https://developers.google.com/appengine/docs/push-to-deploy)

Remember that you also get a detailed dashboard with GAE that tells you number of requests, errors, latency, and all sorts of other interesting stats about the performance of your app. You also get a Memcache viewer and quick ability to reset it. Overall it's a compelling offering.

Big thanks to [@boombatower (opens in new window)](https://twitter.com/boombatower) for providing a huge shortcut to getting this Drupal deployment on GAE going. Hope this helps save you some time troubleshooting if you're venturing into the GAE world with Drupal.

\- See more at: http://www.appnovation.com/blog/drupal-setup-google-app-engine#sthash.JYC1uSqy.dpuf

[![](https://cdn.sanity.io/images/ey850001/production/36eb314260fb474cacc1b3a473d7e8402d997898-68x68.png?w=68&auto=format) Appno Blogger Appnovation Coop · Appnovation](/people/appno-blogger.md) 

## Keep reading

[![What is Sovereign AI](https://cdn.sanity.io/images/ey850001/production/a5889abdd5e80376912546622e046e3fbef234b4-2496x1664.png?w=640&auto=format)](/insights/what-is-open-source-sovereign-ai.md)

 Article · 7 min AI 

### [What Is Open Source, Sovereign AI?](/insights/what-is-open-source-sovereign-ai.md)

Every company is encouraging more AI, and almost every AI bill is climbing. Sovereign AI is about two kinds of control: over your data and over your costs. Here's why open source sits at its foundation.

[Iain MacNeil](/people/iain-macneil.md) Article 

[![AI-first experience design](https://cdn.sanity.io/images/ey850001/production/8bbc2418e87924ef10f36115478a2e10d5bed95e-1584x624.jpg?w=640&auto=format)](/insights/how-build-ai-first-experience-without-throwing-out-everything-youve-already-built.md)

 Article · 6 min AI Sep 10, 2026 

### [How to Build an AI-First Experience Without Throwing Out Everything You've Already Built](/insights/how-build-ai-first-experience-without-throwing-out-everything-youve-already-built.md)

Users now expect a direct answer, not a list of links to click through. Here's how organizations can layer an AI-First experience onto their existing website or app, in weeks rather than years.

[Andrew Douglas](/people/andrew-douglas.md) Article 

[![What Becomes Possible When AI Can Read All the Data](https://cdn.sanity.io/images/ey850001/production/c28ab0bd26753421ee42937e13adc7a7f19b47f0-1296x510.jpg?w=640&auto=format)](/insights/what-becomes-possible-when-ai-can-read-all-data.md)

 Article · 4 min AI Sep 09, 2026 

### [What Becomes Possible When AI Can Read All the Data](/insights/what-becomes-possible-when-ai-can-read-all-data.md)

Most of the world's data has never been analyzed, only sampled. AI changes that. How AI-ready data platforms unlock questions no one could ask before.

[Appnovation](/people/appnovation.md) Article 

## Get the thinking,  
*before everyone else.*

One considered email a month. New essays, field notes from live engagements, and the occasional strong opinion. No noise.
