Install Confluence Server on a Raspberry Pi 4

Atlassian discontinued Confluence Server, see this. If you have a license, just use it until 2024.


References

Install Confluence

  • Install DiePi or Ubuntu Server.
  • Configure swap to 1GB-2GB (just incase)
  • Setup some prerequisite:
sudo apt install net-tools
sudo apt install -y fontconfig
  • Create account to run Confluence and switch to that account
sudo /usr/sbin/useradd --create-home --comment "Account for running Confluence" --shell /bin/bash confluence
su - confluence
  • Download Confluence and Java binaries:
wget https://www.atlassian.com/software/confluence/downloads/binary/atlassian-confluence-7.10.0.tar.gz
wget https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.9.1%2B1/OpenJDK11U-jre_aarch64_linux_hotspot_11.0.9.1_1.tar.gz

If you want to download Java from Oracle, head to:

https://www.oracle.com/java/technologies/javase-jdk11-downloads.html

Copy link from download button and extract the next link, add -pub. E.g:

wget https://download.oracle.com/otn-pub/java/jdk/11.0.9+7/eec35ebefb3f4133bd04...

  • Extract the binaries
tar xf atlassian-confluence-7.10.0.tar.gz
tar xf OpenJDK11U-jre_aarch64_linux_hotspot_11.0.9.1_1.tar.gz
# Rename the Java folder to jre, just to make it clear.
mv jdk-11.0.9.1+1-jre  jre
  • Create confluence home folder:
mkdir confluence-home
# Not required but left here for future reference
chown -R confluence confluence-home
chmod -R u=rwx,go-rwx confluence-home
chown -R confluence atlassian-confluence-7.10.0/logs
chown -R confluence atlassian-confluence-7.10.0/work
chown -R confluence atlassian-confluence-7.10.0/temp
  • Update config files for home folder. The file is atlassian-confluence-7.10.0/confluence/WEB-INF/classes/confluence-init.properties .
# Add new blank line
echo >> atlassian-confluence-7.10.0/confluence/WEB-INF/classes/confluence-init.properties 
# Setup the confluence-home
echo confluence.home=`pwd`/confluence-home >> atlassian-confluence-7.10.0/confluence/WEB-INF/classes/confluence-init.properties 
# Double check
tail atlassian-confluence-7.10.0/confluence/WEB-INF/classes/confluence-init.properties 
  • Update startup / system options
nano atlassian-confluence-7.10.0/bin/setenv.sh

Since synchrony (Collaborative Editing service) will not work, we limit its max memory for now. Add this to setenv.sh file:

CATALINA_OPTS="-Dsynchrony.memory.max=256m ${CATALINA_OPTS}"


We will disable it after installation.

  • Setup env variables and start Confluence
echo export JAVA_HOME=`pwd`/jre > env.sh
echo export PATH=\$JAVA_HOME/bin:$PATH >> env.sh

source env.sh

cd atlassian-confluence-7.10.0
./bin/start-confluence.sh

# Check and wait until the CPU usage < 10%
htop

The first time startup will take a while, be patient. Check htop to see if the CPU usage has down to < 10% before continuing.

  • Head to <RPI-IP>:8090 and get started. This also takes a while for the page to load.

Choose Trial if you just want to try with, without setup external database. (H2 will be used).

Choose Production if you have the database ready. Refer to next section to install PostgreSQL before continuing.

Install PostgreSQL (for Production)

Ref: https://confluence.atlassian.com/doc/database-setup-for-postgresql-173244522.html

# Logout user confluence
$ exit
# Now running as root
$ sudo apt-get install postgresql
# Switch to postgres user
$ su - postgres
createuser confluence -P --interactive
Enter password for new role: 
Enter it again: 
Shall the new role be a superuser? (y/n) n
Shall the new role be allowed to create databases? (y/n) y
Shall the new role be allowed to create more new roles? (y/n) n

$ psql
psql (11.9 (Debian 11.9-0+deb10u1))
Type "help" for help.

postgres=# create database confluencedb;
CREATE DATABASE
postgres=#
postgres=# exit

$ # Logout user postgres
$ exit


  • Continue to setup your Confluence after database server is installed.

  • Click Next. It will take around 10 mins to complete database initialization.

Things to do after installation

  • Disable Collaborative Editing (first thing to do, otherwise you can not create / save any new page)

https://confluence.atlassian.com/doc/administering-collaborative-editing-858772086.html

  • Enable page activity

https://confluence.atlassian.com/doc/view-space-activity-2818381.html

  • Setup public access

https://confluence.atlassian.com/doc/setting-up-public-access-156.html

  • Set site homepage

https://confluence.atlassian.com/doc/configuring-the-site-home-page-138140.html