Sourcefabric Manuals

 English |  Español |  Français |  Italiano |  Português |  Русский |  Shqip

Booktype 2.0 for Authors and Publishers

Setting Up The Database

Before you can install your own Booktype server, you will need a database to be available. PostgreSQL ( is the recommended database management system for production servers. If you are setting up a development machine, you can skip this step and use the built-in sqlite database for testing purposes.

The following instructions for setting up PostgreSQL were tested on Debian GNU/Linux 8.2 'jessie' and Ubuntu 14.04 LTS 'Trusty', using sudo for root access to the server.

1. Open a terminal, then enter the following command to install PostgreSQL:

sudo apt-get install postgresql

2. Create the PostgreSQL user booktype-user with the command:

sudo -u postgres createuser -SDRP booktype-user

Enter the password you wish to set in the database, as prompted. You will need to re-enter it for confirmation.

3. Create a database named booktype-db, setting booktype-user as the owner with the -O option. The encoding should be the international UTF-8 character set, as indicated with the -E option.

sudo -u postgres createdb -E utf8 -T template0 -O booktype-user booktype-db

4. Confirm connections to the database booktype-db by booktype-user are allowed, by checking the PostgreSQL configuration file. The exact file name depends on the PostgreSQL version that you are using. For example, if the version was 9.4, the command to edit the file on Debian or Ubuntu GNU/Linux would be:

sudo nano /etc/postgresql/9.4/main/pg_hba.conf  

At the end of the file is a section with client authentication rules, like this:


# "local" is for Unix domain socket connections only
local   all          all                             peer
# IPv4 local connections:
host    all          all       md5
# IPv6 local connections:
host    all         all          ::1/128          md5

If a suitable rule allowing Booktype connections is not enabled, you can add an extra line for a local IPv6 connection at the end of the section, separated by spaces, like so:

host    booktype-db  booktype-user  ::1/128          md5

Save the file with the keyboard shortcut Ctrl+O, and then quit nano with Ctrl+X.

5. Finally, if you have changed the configuration, restart PostgreSQL with the command:

sudo service postgresql restart

You are now ready to install Booktype. See the following chapters for details.

There has been error in communication with Booktype server. Not sure right now where is the problem.

You should refresh this page.