CMDBuild Forum

Installing CMDBuild on Ubuntu/Debian from command line, DigitalOcean instance

This is not a complete installation, but may help people get started while highlighting a couple of issues:

Go to DigitalOcean or any other server provider (including your own), and install the latest Ubuntu (Debian, etc):

#paste one line
apt update; apt-get -y install joe tree unzip fastjar tomcat9 tomcat9-admin postgresql #postgis

#paste one line
apt-get -y dist-upgrade; apt-get -y autoremove; sync; reboot

#log in again, then paste the following all the way to starting tomcat again

systemctl stop tomcat9

ed /etc/tomcat9/tomcat-users.xml <<EOF
/manager-gui
/-->
a
<role rolename="manager-gui"/>
<role rolename="admin-gui"/>
<user username="tomcat" password="s3cret" roles="manager-gui,admin-gui"/>
.
wq
EOF

wget https://netcologne.dl.sourceforge.net/project/cmdbuild/3.2/cmdbuild-3.2.war
mkdir cmdbuild; ( cd cmdbuild; jar -xf ../cmdbuild-3.2.war )
mv cmdbuild /var/lib/tomcat9/webapps/
( cd /var/lib/tomcat9; mkdir conf/cmdbuild; chown -R tomcat conf/cmdbuild webapps/cmdbuild )

# Systemctl sandboxes Tomcat, therefore saving the configuration file will fail unless following is done:
ed tomcat9.service << EOF
/ReadWritePaths
a
ReadWritePaths=/var/lib/tomcat9/conf/cmdbuild/
.
wq
EOF
systemctl daemon-reload

# Documentation says Cmdbuild uses tomcat-jdbc, this is not actually the case
wget https://jdbc.postgresql.org/download/postgresql-42.2.10.jar
mv postgresql-42.2.10.jar /usr/share/java
( cd /usr/share/tomcat9/lib; ln -s ../../java/postgresql-42.2.10.jar )

su - postgres -c psql <<EOF
alter role postgres password 'postgres' login;
EOF

#rm /var/log/tomcat9/*
systemctl start tomcat9

Willing to work on developing this further (eg, GIS installation).

2 Likes

This line should be:

ed /lib/systemd/system/tomcat9.service << EOF

Then you can go to localhost:8080, click “manager”, click “cmdbuild”, then run the initialisation using “postgres” as the user and admin logins, with “postgres” as the passwords.

Not sure if this will help but have a look for the GitHub repository “itmicus/cmdbuild_docker”

It has frequent updates (it is already pre-installed and fully functioning) just need to execute the following command

docker-compose up and use it (please change all passwords for security reasons)

André.

1 Like

If I could see how the Docker image was built, that would be a script similar to what I pasted? I don’t want to use Docker and some of the steps shown in my script fix problems with the operating system, and they answer some of the questions I have seen posted here.

The installation for 3.2 is much cleaner than my old script for 2.5.1, so congratulations to the CMDBuild team for improving the process. Ubuntu / Debian’s use of systemd for sandboxing filesystem access is bound to cause a few questions, and tomcat-jdbc is not being used hence the need to install directly. I will be installing more CMDBuild modules.

I know this is an old post, but just had to reply. You can find the way it is installed in th Dockerfile actually. These are available on Github, for example:
github[dot]com/itmicus/cmdbuild_docker/blob/master/3.3/cmdbuild/Dockerfile

Hi, thank you for the reply. It’s an old topic but still of a great deal of interest as I try and work out how to install extended features of CMDBuild. The Docker build file seems far cleaner than the various issues I had to work through, I wonder how that was done.