Go to page content

Installation

How to install Zotonic.

These instructions are for the most recently released version of zotonic: 0.7.0. For installation instructions for older versions, click here.

The following software needs to be installed:

  • Erlang R14B04 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, downloaded from Google code or cloned from Git.

Steps to install Zotonic

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

cd /path/to/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";

Create a new zotonic site, based on the "blog" skeleton site:

bin/zotonic addsite -s blog yoursite

This will add a site named yoursite. Its default URL will be http://yoursite:8000/ so either put 'yoursite' in your hosts file or change the {hostname} section of the config file.

Edit the generated file priv/sites/yoursite/config, to make sure your database credentials and the hostname are correct, and change the password for the admin. Also make sure that the directory "priv/sites/yoursite/files" and all its subdirectories are readable and writeable for the current user. (Which is the user Zotonic will run under.)

Now, 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/. The username of the admin user is "admin", the default password is 'admin' (which is stated in the priv/sites/yoursite/config file).

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

Archlinux

If you get errors about a missing libcloog-isl.so file, make sure you have installed cloog and isl:
 
pacman -S cloog isl

Windows

Currently, Zotonic is not officially supported on the Windows platform. However, the main dependencies Erlang, PostgreSQL and ImageMagick do work on Windows. The Zotonic distribution contains a "build.cmd" batch-file for building Zotonic on Windows, and a "start.cmd" batchfile for starting. The "zotonic" shell command is currently not supported.

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

Comments

  • avatar

    zohar

    Posted 1 year, 7 months ago.

    Hi,
    some bugs in the document, and a question
    bugs:
    1. "You will be asked to change the admin password before you can proceed into the admin." - I just installed 0.4, no such thing happens.
    2. the config sample - the installation default userpassword was "zotonic" not "yourdbpassword" and if someone copies your "create user" sql script he will encounter a problem.
    3. in ubuntu 8.04 I got an error "no package postgresql-8.4", so I installed 8.3 (compiling postgres gave me too much errors)

    as for the question:
    I do not know how to make the zotonic server "aulo run on reboot" (release mode)

    thanks
    Zohar

  • avatar

    rubyconvict

    Posted 1 year, 7 months ago.

    Hi, newbie question, I installed and configured dependencies, started Zotonic with ./start.sh, but there is nothing listening at http://localhost:8000 or http://127.0.0.1:8000, so what am I doing wrong? Please take a look at this:

    http://gist.github.com/461422

  • avatar

    Marc Worrell

    Posted 1 year, 7 months ago.

    Please post your questions to the Zotonic mailing list: http://groups.google.com/group/zotonic-users

    In your case the answer to your problem might be found here: http://groups.google.com/group/zotonic-users/browse_thread/thread/1077a0805563604b

  • avatar

    rolphin

    Posted 1 year, 6 months ago.

    I try installing zotonic on ubuntu 10.x and found necessary to tweak the create database line as this:
    CREATE DATABASE zotonic WITH OWNER = zotonic ENCODING = 'UTF8' TEMPLATE template0;

    Because psql complains about template1 uisng ASCII ...

  • avatar

    Frioriture

    Posted 1 year, 6 months ago.

    Can i use Zotonic on OVH mutual server ?

  • avatar

    Frioriture

    Posted 1 year, 6 months ago.

    Apparently not... :(

  • avatar

    yanjie

    Posted 1 year, 5 months ago.

    how to resolve the following make error:
    can't find include lib "eunit/include/erl.hrl"

  • avatar

    Marc Worrell

    Posted 1 year, 5 months ago.

    Some Erlang distributions don't include eunit. You will need to install it separately.

  • avatar

    onkara

    Posted 1 year, 1 month ago.

    Install of DB is not happening during first time startup. Though I am able to connect to the database using zotonic dbuser's credentials

  • avatar

    Ludovic Demblans

    Posted 1 year ago.

    Hi,

    When i go to « http://localhost:8000/admin/ » with my browser, i get a 404, and i'm asked for password when i simply go to « http://localhost:8000/ ».

    You should change this documentation !

    Very nice stuff anyway !

  • avatar

    Marc Worrell

    Posted 11 months, 24 days ago.

    @Ludovic Are you using the correct URL? Check your configuration, you might need to use http://127.0.0.1:8000/

    @onkara In an earlier release there was a setup error. This should work nicely in the 0.6 release

  • avatar

    Max T.

    Posted 11 months, 21 days ago.

    on OS X 10.6.0
    after all I trying to run start.sh, but it crashes with

    Erlang R14B01 (erts-5.8.2) [source] [64-bit] [smp:2:2] [rq:2] [async-threads:0] [hipe] [kernel-poll:true]

    Eshell V5.8.2 (abort with ^G)
    (zotonic64195@tm)1> ** Found 0 name clashes in code paths
    {"init terminating in do_boot",{{case_clause,{error,{"no such file or directory","crypto.app"}}},[{zotonic,ensure_started,1},{zotonic,start,1},{init,start_it,1},{init,start_em,1}]}}

    Crash dump was written to: erl_crash.dump
    init terminating in do_boot ()

    whats wrong? I can't find crypto.app

  • avatar

    Max T.

    Posted 11 months, 21 days ago.

    The problem below was solved w/

    sudo port install openssl
    sudo port -v upgrade --enforce-variants erlang +ssl

  • avatar

    Tuve

    Posted 11 months, 10 days ago.

    In the platform notes for mac os erölang should bes installed with ssl, so the comand should be

    sudo port install erlang +ssl

  • avatar

    Arjan Scherpenisse

    Posted 11 months, 9 days ago.

    Thanks, I'll update the docs

  • avatar

    darin

    Posted 9 months, 28 days ago.

    installed on unbutu 9.10.. all appeared to be normal but i don't see any start.sh script anywhere. not in folders listed.. zotonic.. zotonic/priv.. zotonic/priv/sites.. zotonic/priv/sites/zotonicwww.. also checked all folders under each of these.. any ideas?

  • avatar

    darin

    Posted 9 months, 27 days ago.

    looks like i was a little backwards in my letters.. ubuntu 9.10

  • avatar

    Marc Worrell

    Posted 9 months, 16 days ago.

    @darin probably you are using 0.7dev (hg tip). You can find new scripts in the bin directory.

  • avatar

    Arnaud DUSSART

    Posted 8 months, 30 days ago.

    Nice job.
    I have 2 servers. One I have for long time with a Postgres server, and an other one (VM under esxi 4.1) I've just created to test Zotonic.
    It works fine except just for a detail:
    If like me, you put your DB in a server and zotonic in an other, don't forget to install a postgresql client on zotonic's side to have features like pg_dump. There is an admin module (backup..) that need it.

  • avatar

    Arnaud DUSSART

    Posted 8 months, 30 days ago.

    Another comment about the way I choose to test Zotonic that could be interesting in this installation section:

    I tried to stress the zotonic exemple site with a 1 vCPU virtual server and with a 6 vCPU virtual server.
    No doubt, It become very very scalable when you can use a multi-processor or multi-core server!

  • avatar

    Kerry Liu

    Posted 6 months, 27 days ago.

    I am trying 0.6.1 on windows with Cygwin, I found the first issue is when I try to open http://localhost:8000/admin/, I got 404 error, is it anything changed in 0.6.1 which does not follow the installation help here?

  • avatar

    Marc Worrell

    Posted 6 months, 22 days ago.

    @Kerry can you post your question to the Zotonic users mailing list? There are people running on Windows there.

  • avatar

    Iván

    Posted 5 months, 24 days ago.

    I think this doc should be more clear about the need of using a word without dots for the site name and that the real hostname must *only* be in hostname of the config file or the host file. Also, it mentions http://localhost:8000 as a possible local address for a site and that will never work because it's the address to Zotonic's control panel.
    http://groups.google.com/group/zotonic-users/browse_thread/thread/5365e900df177dc8#

  • avatar

    Arjan Scherpenisse

    Posted 5 months ago.

    The addsite command in git master now contains check if the site name is valid.

  • avatar

    Ivan Martinez

    Posted 2 months, 29 days ago.

    Worth noting that you need one database user and schema for every website you plan to create, not one for the entire Zotonic installation as I fiirst thought.

  • avatar

    Andreas Stenius

    Posted 1 month, 29 days ago.

    @Ivan: You can use the same database user across all sites (and even zotonic instances), but you need a separate table namespace for each site; either as separate databases or in separate schemas in a shared database (or a mix there of).

  • avatar

    Alex Shafir

    Posted 11 days, 20 hours ago.

    Tried to follow intstallation instructions for 0.7.4. Erlang release R15B - the latest one. Got a crash:

    $ ./start.sh
    Eshell V5.9 (abort with ^G)
    (zotonic001@ashafir.local)1> ** Found 0 name clashes in code paths
    (zotonic001@ashafir.local)1> ** Found 0 name clashes in code paths
    (zotonic001@ashafir.local)1> ** Found 0 name clashes in code paths
    (zotonic001@ashafir.local)1> opening log file: "/home/alex/zotonic/priv/log/access.log.2012_01_25_00"
    (zotonic001@ashafir.local)1>
    =INFO REPORT==== 24-Jan-2012::18:04:28 ===
    gen_smtp_server starting at 'zotonic001@ashafir.local'
    (zotonic001@ashafir.local)1>
    =INFO REPORT==== 24-Jan-2012::18:04:28 ===
    listening on {0,0,0,0}:2525 via tcp
    (zotonic001@ashafir.local)1> {"init terminating in do_boot",{{badmatch,{error,{shutdown,{zotonic_app,start,[normal,[]]}}}},[{zotonic,start,1,[{file,"src/zotonic.erl"},{line,44}]},{init,start_it,1,[]},{init,start_em,1,[]}]}}

    Crash dump was written to: erl_crash.dump
    init terminating in do_boot ()

    Any insight will be appreciated!

  • avatar

    Hagus

    Posted 3 days, 16 hours ago.

    @Alex - if you're on OS X using homebrew:

    * brew uninstall erlang
    * go to /usr/local/Library/Formula
    * revert the erlang formula to the R14B04 version using "git checkout aedacdf209815450204602ff403bb5c4510d6a3a erlang.rb"
    * brew install erlang

    Although note that I got the same error, tried reverting to R14, but what ended up fixing it was finding another process bound to port 8000.

    However I think reverting to R14 is still a good idea, as a lot of things that were deprecation warnings during compilation of Zotonic with R14 are now hard problems on R15.