Recently, when leading a training workshop for OpenERP, one of our attendees helped me take a mostly automated method of installing OpenERP and turn it into a 100% automated method.  Piping YES to commands, and using SED took me back to my University days when I first learned UNIX!

Since I also got a comment from my post My first hour with OpenERP 7 asking for the VM I used, I decided to share both the script and the VM.

The script will automatically install the latest LTS (Long Term Support) revision of OpenERP (version 7.0.).  Like I do often, I created a Virtual Machine to test this method.  Virtual machines have many benefits, and are great for 'trying out' new software.  I actually get better performance from OpenERP running it on Ubuntu inside a VM on my windows machines!

On the VM, I used the latest LTS release of Ubuntu (version 12.04.1) and I have shared the VM at the end of the post for anyone who wants it. 

What you need:

The Virtual Machine image was created using Virtual Box.  You will need to download that software from https://www.virtualbox.org/wiki/Downloads and install it to create your own Virtual Machine image, or to run the one I have shared.

I will assume you have Virtual Box installed on your 'host' operating system, and have created a VM and installed Ubuntu 12.04.1 on it.  There are PLENTY of resources on the web if you need detailed help with that!  I also installed the openssh-server package while installing the OS.

Once you have done that, you are ready to install OpenERP.  I created a user called ubuntu to download, install and run OpenERP.  If you use a different user, you will need to adjust the commands in the script to use your user instead.

The install script:

Start by updating the package index:

yes | sudo apt-get update

Then, upgrade any outdated packages:

yes| sudo apt-get upgrade

Once you have done this, you will be able to copy and paste the following into your console, or paste it into a script to run:

#create the install directory for OpenERP
sudo mkdir /opt/openerp
sudo chown ubuntu /opt/openerp
sudo chgrp ubuntu /opt/openerp
cd /opt/openerp

#install PostgreSQL
yes | sudo apt-get install postgresql

#create a postgres user for OpenERP
sudo su postgres
createuser -s -e ubuntu
exit

#install Python dependencies
yes | sudo apt-get install python-dateutil python-docutils python-feedparser python-jinja2 python-ldap python-libxslt1 python-lxml python-mako python-mock python-openid python-psycopg2 python-psutil python-pybabel python-pychart python-pydot python-pyparsing python-reportlab python-simplejson python-tz python-unittest2 python-vatnumber python-vobject python-webdav python-werkzeug python-xlwt python-yaml python-zsi poppler-utils

#install GDATA
wget http://gdata-python-client.googlecode.com/files/gdata-2.0.17.tar.gz
tar zxvf gdata-2.0.17.tar.gz
cd gdata-2.0.17/
sudo python setup.py install

cd ..

#install bazaar
yes | sudo apt-get install bzr
yes | sudo apt-get install bzrtools

#install the three OpenERP branches
bzr co lp:openerp-web/7.0 web
bzr co lp:openobject-server/7.0 server
bzr co lp:openobject-addons/7.0 addons


#setup logfile
sudo mkdir /var/log/openerp
sudo chown ubuntu:root /var/log/openerp

#setup configuration file
sudo cp /opt/openerp/server/install/openerp-server.conf /etc/
sudo chown ubuntu: /etc/openerp-server.conf
sudo chmod 640 /etc/openerp-server.conf
sudo sed -i'' 's/db_user = .*/db_user = ubuntu/g' /etc/openerp-server.conf
sudo echo "logfile = /var/log/openerp/openerp-server.log" >> /etc/openerp-server.conf
sudo echo "addons_path=/opt/openerp/addons,/opt/openerp/web/addons" >> /etc/openerp-server.conf

#setup auto-startup
cd /etc/init.d
sudo curl -O http://174.129.226.169/openerp_config/openerp-server
sudo sed -i'' 's/USER=.*/USER=ubuntu/g' /etc/init.d/openerp-server
sudo chmod 755 /etc/init.d/openerp-server
sudo chown root: /etc/init.d/openerp-server
sudo update-rc.d openerp-server defaults
sudo /etc/init.d/openerp-server start


That's it!

Once you are done, reboot the server to test that OpenERP starts automatically:

sudo reboot -h now

If you see the following, it worked!

Download the result:

I have shared the VM at http://bit.ly/Uutkd5

The username and password for the VM is ubuntu and the root account password is locked as it is in the default install.

You will need 7ZIP to unpack it, I used ULTRA compression so it will take longer than a normal archive - expect about 15-20 minutes.

DON'T FORGET to change the network settings to match the bridged adapter present on your host!  It won't find my network card on your machine!  If you need help getting up and running with Virtual Box, I suggest searching the web - there are lots of good resources available.

Enjoy!

Hope that is helpful - when you have had a chance to play around, let me know what you think of OpenERP 7.0 in the comments!
 


Comments

Tony
01/10/2013 1:35am

Following your tutorial, I've successfully set up a test environment by the VM you shared. Great job and I greatly appreciate it!

Heard that some upgrading is going on, how do I upgrade my test environment? Thanks!

henrz
01/15/2013 11:35pm

Hi Tony,

Try this : http://doc.openerp.com/v6.1/install/linux/updating.html

Phil
01/21/2013 5:29am

Nice VM. Is the minor upgrade instruction valid for upgrading from 6.1 to 7?

I am just trying a few things out on your VM, it is a lot better than 6.1!

Ray
01/21/2013 9:09pm

Upgrading from 6.1 to 7.0 is a major upgrade. You are best off using OpenERP's warranty service which provides free migration. There is a community project but I have no experience with it.

Henrz
01/14/2013 7:22am

Hi, thank for the tutorial!

But I am stuck and cannot make it work. I am using Vmware instead of VirtualBox, is there any difference? Thanks

Henrz
01/14/2013 7:38am

Ok my bad, I just realized that a simple copy past of the #install Python dependencies part does not work :) I had to remove the \

Borrie
01/15/2013 5:43am

Hey, Great tutorial! It works!!

I have one question, If I goto apps or Updates I get OpenERP Apps unreachable, only showing locally available modules.

Do you know how to solve this?

ERPeter
01/19/2013 1:10am

What exactly does this line:
sudo curl -O http://174.129.226.169/openerp_config/openerp-server
?

Ray
01/19/2013 1:31pm

curl simply gets HTTP content as a text file.

Bzrius
01/19/2013 4:45am

Why do you use 'bzr co' (=bzr checkout) instead of 'bzr branch'?

Ray
01/19/2013 1:32pm

Check out "Difference between a Branch and a Checkout" at http://wiki.bazaar.canonical.com/CheckoutTutorial

Bzrius
01/19/2013 2:42pm

I know the difference! But I don't see why you would checkout a branch for this example.

Ray
01/21/2013 9:22pm

We find that a checkout provides better workflows when you have multiple developers working together on multiple branches

Noob
01/19/2013 2:47pm

"If you see the following, it worked!"
I can see it, but can't create a new DB and log in. There must be a problem with the user account and configured passwords. Someone else with this problem? Which user and password should be saved in which config files?

Ray
01/21/2013 9:26pm

What do the log files tell you?

/var/log/openerp/openerp-server.log

The instructions I gave create a database user without a password and configure OpenERP not to use one.

Andrew
01/21/2013 12:34am

The guest OS is 64bit - could you upload a 32bit version of the Virtual Box file please?

Ray
01/21/2013 9:27pm

Sorry - We don't have any 32 bit host systems!

01/21/2013 9:09am

Am I missing something? Don't get me wrong I appreciate the effort and great info, but why not install open ERP and THEN upload the finished virtual machine.

Command line operation is why I hate using linux (which is a shame because it's a great OS).

Ray
01/21/2013 9:12am

The VM we supplied has OpenERP installed on it.

Eric
01/25/2013 7:39am

Thanks for the tutorial, worked perfectly. How do I use pgadmin for Windows with this setup? Every password I try comes back invalid. did you apply a postgres password?

Thanks

Ray
02/01/2013 4:25pm

At version 6.1:

openpg was the default PostgreSQL user name.
openpgpwd was the default password.

Try those.

yarik
01/28/2013 6:51am

Good tutorial. But once I run the openserver on the log I can read:

WARNING ? openerp.addons.google_docs.google_docs: Please install latest gdata-python-client from http://code.google.com/p/gdata-python-client/downloads/list

I, again, downloaded the package and succesfully installed…same result, I’m still getting the warning message. Any clue on what could be wrong?

yarik
01/29/2013 2:01am

Downloading your VM do the trick. But I'm confused why mine didn't worked as expected, only that warning on the gdata library was not ok.

yarik
01/29/2013 2:15am

Ooops! no...checked the log, the warning is also present on this VM... but at the end, does it really harms the correct functioning of the openerp server?

Ray
02/01/2013 4:26pm

gdata can't be installed via sudo apt-get as the repository has the wrong version.

In my original instructions, and the way the VM was setup, I did this.

The instructions have been updated.

No problems with using OpenERP until you utilize the Google integration functionality

Fraser
01/29/2013 4:57am

Thanks for the great article!

Before I found your site I tried to install a virtualbox ubuntu/openerp server, but got an error when trying to create a database.

Then I start your server from your VDI: new machine, new config.... but I get the exact same error. I can get the the start page of openerp, but cannot create my first database.

The exact same error on to different servers with the only thing in common is my osx 10.8 virtualbox configured with network bridge to my WIFI so I can access from my browser with a url like: http://192.168.1.3:8068/

This is strange! Any ideas. Error Message (from browser) below.

Thanks and br!



OpenERP Server Error

Client Traceback (most recent call last):
File "/opt/openerp/web/addons/web/http.py", line 195, in dispatch
response["result"] = method(self, **self.params)
File "/opt/openerp/web/addons/web/controllers/main.py", line 718, in create
params['create_admin_pwd'])
File "/opt/openerp/web/addons/web/session.py", line 28, in proxy_method
result = self.session.send(self.service_name, method, *args)
File "/opt/openerp/web/addons/web/session.py", line 95, in send
raise xmlrpclib.Fault('AccessDenied', str(e))


Server Access denied.

Ray.
02/01/2013 4:27pm

Which password are you using?

admin is the default.

Fraser
03/01/2013 7:10am

Whadayaknow, it worked! Thanks Ray!

Fraser
01/29/2013 5:30am

excuse the typo. i meant :
http://10.11.65.140:8069/

Fraser
03/01/2013 9:04am

I have just installed this on Amazon EC2 and it works brilliantly! Thanks again Ray.


p.s. the only error during the process was when running the bazaar script for add ons: ERROR: No such file: 'http://bazaar.launchpad.net/~openerp/openobject-addons/7.0/.bzr/repository/pack-names') but it doesn't seem to matter (yet).


Comments are closed.

'
Ursa Information Systems - Business Efficiency Through Technology
OpenERP 7 ERP Consulting Operations Research SAP Dynamics Quickbooks