+1-757-461-3022 x124

How to Install xTuple PostBooks and TimeTrex on the same Ubuntu server

Contributed by: Seth McClain of The Hyde Company


In this document we'll be installing TimeTrex Community Edition v9.1.3 and xTuple PostBooks Edition on Ubuntu Server 16.04.1 LTS 64-bit. We will configure them to be able to communicate with each other for an end result of having one web-enabled appliance that should be able to meet most if not all of your payroll and accounting needs.

Both xTuple and TimeTrex offer paid commercial support for their products, so if you encounter difficulty, help is available. Both companies offer cross-platform and open-source versions. For more information on these companies and their products, please contact them.

xTuple: https://xtuple.com/

TimeTrex: https://www.timetrex.com/

Install Ubuntu Server 16.04.1 LTS

Note: There is an excellent video covering the Ubuntu and PostBooks install process. It covers everything we're going through here. This text is only provided for those who prefer having something to read as well. Here is a link to the video, in case you would like to refer to that: https://xtupleuniversity.xtuple.com/library/videos/setting-web-enabled-server.

You can fetch the ISO from Ubuntu's site here:


If your destination server is 64 bit, the file you should fetch will be named ubuntu-16.04.1-server-amd64.iso

When prompted during install it would be quite handy to select the openssh server package.  If you miss this step it should be trivial to fetch it after the fact.

One of the first things I like to do in a new install is ensure that it is updated:

sudo apt-get update
sudo apt-get upgrade

Now that we're current we can begin to tinker.

Install xTuple PostBooks Edition

Drop to a shell and type the following commands:

git clone https://github.com/xtuple/xtuple-admin-utility.git
cd xtuple-admin-utility && ./xtuple-utility.sh

A menu will appear. Here are the steps to follow:

  • Select option #1, "Provisioning Menu"
  • From there you will see a list of options starting with "installpg"
  • Let's choose all the options other than "qtclient"
  • Just follow the on-screen instructions from here and you're good to go

As I was following the instructions, here is what I entered and it appears to work properly:

"Enter Cluster Name (make sure it isn't already in use!)"


"Enter Database Port (make sure it isn't already in use!)"


"Enter Locale"


"Would you like the cluster to start at boot?"


"Creation of database cluster xtuple using version 9.3 was successful. You will now be asked to set a postgresql password"


"New postgres password"


"Password for user postgres successfully reset"


"Initializing cluster successful."


Choose any of these options, but the following one should work for testing:

"Choose Version"

4 PostBooks 4.9.5 Demo

"Download complete. Would you like to deploy this database now?"


"New database name"  (do not use any special characters or dashes)


"Database demo495 successfully restored from file /home/username/xtuple-admin-utility/tmp.backup"


"Choose Web Client Version" (Note: I chose the latest non-beta version.)

2 4.9.5

"Enter a name for this xTuple instance"


"List of databases on this cluster"


"Would you like to install the commercial extensions?"


"Host name"


"Domain name"


"Site name."


"Would you like to generate a self signed SSL certificate and key?"


"SSL Certificate file path"


"SSL Key file path"


"Port number."


"The following actions were complete."


"Main Menu"


Now you should have a web enabled xTuple server. Time to move on to setting up TimeTrex on the same machine.

Install TimeTrex Community Edition v9.1.3

I prefer PHP version 5 so we'll be adding a repository for that version of PHP. If you prefer PHP 7, please feel free to post an additional tutorial for that version.

sudo add-apt-repository ppa:ondrej/php

Again, I love being current.  So after adding a new repo, we'll update.

sudo apt-get update
sudo apt-get upgrade

Next we should install some of the requirements for TimeTrex (and the openssh server in case we missed it during the OS install)

sudo apt-get install php5.6 php5.6-bcmath php5.6-soap php5.6-gd php5.6-zip php5.6-xml php5.6-pgsql unzip php5.6-mbstring openssh-server

Since we've installed a number of different web packages, we should restart Apache:

sudo service apache2 restart

We should also create a database and user for TimeTrex

sudo su -l postgres
create user timetrex with password 'timetrex';
create database timetrex with owner = timetrex;

(Note: You should probably choose a better password than "timetrex".  Enter "\q" to exit out of the psql interface and then you can type "exit" to return to your normal user.)

Now that we have the dependencies out of the way we can fetch the source for TimeTrex.  It is located at the following URL:


Please grab the file named "TimeTrex_Community_Edition_v9.1.3.zip"

After that has finished downloading, you can extract it with the following command:

unzip TimeTrex_Community_Edition_v9.1.3.zip

Now let's move it into web space

sudo mv TimeTrex_Community_Edition_v9.1.3 /var/www/html/timetrex

TimeTrex for some reason wants to be able to read and write all of the web files, so we'll need to do some permissions changes:

sudo chown -R www-data /var/www/html/timetrex/

It also needs a number of other directories to exist:

sudo mkdir -p /tmp/timetrex /var/log/timetrex /var/timetrex/storage
sudo chown www-data /tmp/timetrex
sudo chown www-data /var/log/timetrex
sudo chown www-data /var/timetrex/storage
sudo mv /var/www/html/timetrex/timetrex.ini.php-example_linux /var/www/html/timetrex/timetrex.ini.php

You can edit the timetrex.ini.php file however you want, but you can safely skip it for now.

At this point you should be able to go to the TimeTrex installation URL and follow their on-screen instructions to set up your company!

If you don't know the IP of the machine, you can find it by typing the following command:

ifconfig -a

We'll refer to this IP as "{server-ip}"

Now put this URL into your browser to complete the installation process:


If it does, for some reason, redirect you to a page that doesn't exist, just ignore that error and go to one that does like the following.

After going through their installer, your site should be functional here:


After setting up your specific company data and users, the next step is to link TimeTrex to xTuple PostBooks.

Enable foreign data wrappers on your xTuple database

On the xTuple server type the following:

sudo su -l postgres
psql -d demo495
create extension postgres_fdw;

Install xTuple Updater on a local desktop machine

Now it is time to switch gears.  Instead of working with the xTuple and TimeTrex servers, we will be working on the client side of things.  I'm assuming that you're using 64-bit Ubuntu 16.04.1 locally as well.  The following instructions are for installing and using the xTuple Updater on a local Ubuntu machine.

dpkg --add-architecture i386
apt-get update
apt-get upgrade
apt-get install libc6:i386 libstdc++6:i386 libkrb5-3:i386 libgthread-2:i386 libglib2.0-0:i386 libfreetype6:i386 libsm6:i386 libxrender1:i386 fontconfig:i386 libxext6:i386

There is an excellent video on this process that you should definitely watch.


Go to this URL and fetch the binaries that are applicable for your system:


I'm downloading Updater-2.2.5-Linux.tar.bz2

Unzip, mount or extract the package:

tar -xvjf Updater-2.2.5-Linux.tar.bz2
cd Updater-2.2.5-Linux

Enter your admin username and password:

Username: admin

Password: admin

Click on "Options..." and set the following values:

Server: {server-ip}

Port: 5432

Click on "SAVE and then "LOGIN"

You will need this free package from the xTuple marketplace. This is a great time to familiarize yourself with it.


In the Updater application choose "File" then "Open" and select "timetrex-0.2.0.gz" then "Start Update." Hopefully this completes without errors and you can move on to the next step.

Install the xTuple client on your local desktop machine

Here is where some of the xTuple clients are for version 4.9.5


Fetch the one for your operating system, and extract it.  I'll assume that you're running Ubuntu again.

tar -xvjf xTuple-4.9.5-gc936d99-Linux64.tar.bz2
cd xTuple-4.9.5-gc936d99-Linux64/

Grant permissions in xTuple for your user

Log into your xTuple server as the admin user, using the xTuple client.

Choose "System" followed by "Maintain User Accounts"

There should be at least two options to add to your user, "ImportPayroll" and "PayrollSetup" but "Add All->>" should also cover your bases.

Now choose "System" followed by "Rescan Privileges" to have the new permissions applied to your logged in user session.

Set up payroll import in xTuple

With your new permissions, you should have access to the "Payroll" menu under "Accounting."

Choose the "Accounting" menu, followed by "Payroll" and "Setup Payroll Import."

In the "Server Information" tab, enter the following values:

Name: TimeTrexImportServer


Database: timetrex

Port: 5432

Now click on "Create Foreign Server"

This should move you to the "User Mapping" tab where you can enter these values:

User Name: timetrex

Password: timetrex

Now click on "Create Mapping"

This should move you to the "Create Foreign Tables" tab where you can click on "Create Foreign Tables."

That is it. Once you have some TimeTrex payroll data to import, you should be able to import it into xTuple PostBooks.

Feel free to ask any questions in the forums, or on FreeNode's IRC channel #xtuple

93 users have voted.