Go to page content

Installation (Zotonic <= 0.6.x)

How to install Zotonic before version 0.7

These instructions are for zotonic: 0.6.0 and below, and should be considered outdated. See the installation instructions for a more recent version here.

The following software needs to be installed:

  • Erlang R13B or newer. use a package (see platform-specific notes below) or build it from source.
  • ImageMagick 'convert' and 'identify' tools (also install libjpeg, -tiff, -png and other required libraries).  Make sure that the convert and identify tools are in your path so that Zotonic can find them. For auto-rotation to work you'll need the "exif" utility as well.
  • PostgreSQL (preferably 8.4 or newer).
  • The Zotonic source code.

Steps to install Zotonic

Make sure you put the zotonic source in a directory named 'zotonic' (important for now; we're working on a solution for this).

Type "make" in the root of zotonic (there where the Makefile is located). For FreeBSD, check the platform notes.

cd zotonic
make

Create an user and database in PostgreSQL:

CREATE USER zotonic WITH PASSWORD 'yourdbpassword';
CREATE DATABASE zotonic WITH OWNER = zotonic ENCODING = 'UTF8';
GRANT ALL ON DATABASE zotonic TO zotonic;
\c zotonic
CREATE LANGUAGE "plpgsql";

Now, rename the config file located at "priv/sites/default/config.in" to "priv/sites/default/config". Mind you, the new name of the file is just "config", and not "config.in" anymore. Many users forget this step.

Then, edit that file and change the values of dbpassword, sign_key_simple and sign_key, here marked in bold:

% Configuration of the default site.
[
% This site is enabled or not.
{enabled, true},
 
% Atomic hostname, MUST be equal to the directory name of this site.
{host, default},
 
% Hostname for virtual host support
{hostname, "127.0.0.1:8000"},
{hostalias, "localhost:8000"},
% PostgreSQL database connection
{dbhost, "127.0.0.1"},
{dbport, 5432},
{dbuser, "zotonic"},
{dbpassword, "yourdbpassword"},
{dbdatabase, "zotonic"},

% Key used for signing image urls with image manipulations (crop, rotate, resize, etc.)
% A new key will force regenerating images, which takes cpu time and will fill your hard disk.
{sign_key_simple, <<"--change-me--">>},

% Key used for signing postbacks - this _must_ be a hard to guess key, otherwise your system is insecure.
% When not defined, then zotonic will generate a new key on every restart.
% When a new key is generated then all postbacks from old html pages will fail.
{sign_key, <<"--change-me--">>}
].

Make sure that the directory "priv/sites/default/files" and all its subdirectories are readable and writeable for the current user. (Which is the user zotonic will run under.)

chmod -R +rw priv/sites/default/files

Start zotonic in debug mode:

./start.sh

You see zotonic starting up, lots of messages pass by, and zotonic will install the initial database. When something goes wrong here, then it is almost always a problem with the database connection. Check your database configuration in the config file.

Point your browser to http://localhost:8000/ or logon as admin (no password) at: http://localhost:8000/admin/. You will be asked to change the admin password before you can proceed into the admin.

Note: for Zotonic < 0.5, the default password is 'admin'.

When all done, then you can stop the erlang shell with:

q().

Operating system specific notes

Mac OS X

With MacPorts you can install Erlang and ImageMagick using the following commands:

sudo port install erlang +ssl
sudo port install ImageMagick

EnterpriseDB has an excellent PostgreSQL installer available at http://www.enterprisedb.com/products/pgdownload.do#osx

For a very basic step-by-step installation on OSX, chick this http://timbenniks.nl/blog/712/step-by-step-guide-to-install-zotonic-on-osx.

FreeBSD

If you're running on FreeBSD, make sure you've got the 'GNU' 'make' (check with 'make --version', which should give you GNU, and version info) If you're not running GNU-make as a default, edit the Makefile to run with 'gmake' (make sure gmake is available first).

Ubuntu 9.04 (jaunty)

You'll need to download Erlang and build it from source. Before building, make sure you install these packages:

sudo apt-get install build-essential unixodbc-dev libncurses-dev libssl-dev libxml2-dev libexpat1-dev

PostgreSQL and Imagemagick are available on Ubuntu as packages:

sudo apt-get install postgresql-8.4 imagemagick

Ubuntu 9.10 (karmic)

Follow the instructions for Ubuntu 9.04, but instead of compiling erlang, you can just install Erlang but you need the ssl and xml dev libraries as well for XMPP:

sudo apt-get install erlang build-essential libxml2-dev libexpat1-dev

Windows

Currently, Zotonic has not been tested on the Windows platform. However, the main dependencies Erlang, PostgreSQL and ImageMagick do work on Windows, so, if you're adventurous, it should be possible to get it running.

For a start, you'll have to compile Zotonic and make a Windows version of start.sh, probably as a .bat file.... We'd love to hear your progress! Post a message to zotonic-developers@googlegroups.com to inform us of your progress.

This page is part of the Zotonic documentation, which is licensed under the Apache License 2.0.