Installing Confluence on Linux from Archive File

On this page

Still need help?

The Atlassian Community is here for you.

Ask the community

These instructions apply to:

  • Confluence distributed as an archive (tar.gz) file.
  • Linux or Solaris systems. If you are installing Confluence on a different system, please refer to Installing Confluence.

Hint: If you're evaluating Confluence on Solaris or OSX, this is the version you need to install. 

On this page:

1. Before you start

Please check the following points:

  1. Ensure that your system meets the minimum requirements to run Confluence. For more information, please read the detailed System Requirements.
  2. Have your Confluence license key ready. You can obtain a trial, free or commercial license, or retrieve your existing license key at my.atlassian.com.
  3. You must be able to use a command prompt and install Java to continue.
  4. Make sure that you use a Gnu version of zip application - Solaris and AIX are known to have problems with zip, because they use their own (old) versions instead of the Gnu version.

2. Install Java

Please refer to the Supported Platforms for the required version of Java. (OpenJDK is currently not supported)

If you're not sure whether you have Java installed correctly:

  1. Open a shell console.
  2. Type echo $JAVA_HOME in the shell console and then press Enter
  3. View the result:
    • If a line is displayed such as /opt/jdk1.8.0_45 or /usr/lib/jvm/java-8-sun, then Java is installed and properly configured.
    • If nothing is displayed, then you either need to install Java or set the $JAVA_HOME environment variable. You can set this environment variable in your user account's 'profile' file. Alternatively, you can set this after installing Confluence (in step 4 below) by defining this path in your Confluence installation's setenv.sh file, usually located in the Confluence bin directory.

If you need to install Java, follow these instructions:

  1. Go to the Java download page and download the latest JRE or JDK that is listed on the Confluence Supported Platforms page. (Confluence works with either the JDK or the JRE.)
  2. When the download has finished, run the Java installer. Detailed installation instructions are provided on Oracle's website.
    Note: you will be asked to choose an installation directory. Make a note of this directory, you'l' need it later.

3. Download and extract the Confluence installation file

If you have not downloaded Confluence already, download the TAR.GZ file.

Use your unzip program to unzip the installation file to a directory such as /home/jsmith/confluence-2.7.0-std/.

Most Linux/Solaris users can use any unzip program (such as GNU Tar) to extract the Confluence installer. However, Solaris users should not use the Solaris Tar program due to a known issue associated with its use in extracting Confluence. Use another application such as GNU Tar instead.

For example, change directory to your home directory in Linux and enter the following commands in the shell console:

    • gunzip confluence-<version>-std.tar.gz
    • tar -xf confluence-<version>-std.tar
      (where <version> refers to the Confluence version you downloaded.)

(info) As usual on Linux/Solaris-based operating systems, avoid using spaces in your directory path. The directory into which you unzipped the Confluence installation is called the Confluence Installation directory. Next you will define the Confluence Home directory.

4. Define your Confluence Home Directory

Now you need to define the Confluence Home directory. This is where Confluence will store its configuration information, indexes and attachments. Another term for 'Home directory' would be 'data directory'.

You should use different paths for your installation and home directories. This will facilitate upgrades. Examples of Installation and Home Directories:

  • Installation directory: /usr/local/confluence/
    If you wish to install or maintain multiple versions of Confluence, you can add a version number to the Confluence installation directory name like /usr/local/confluence-3.1-std/ and optionally, create the symbolic link /usr/local/confluence/ that points to /usr/local/confluence-3.1-std/
  • Home directory: /usr/local/confluence-data/
  1. Open your Confluence Installation directory (created when you unzipped Confluence — see above).
  2. Under the Installation directory, find this file: confluence/WEB-INF/classes/confluence-init.properties
  3. Open the confluence-init.properties file in a text editor.
  4. Scroll to the bottom and find this line:

    # confluence.home=c:/confluence/data
    
  5. Remove the '#' and the space at the beginning of this line, so that Confluence no longer regards the line as a comment. The line should now begin with confluence.home
  6. If you decide to change the Confluence Home directory from the default, use an absolute path rather than a symbolic link to specify the path and file name. For example:

    confluence.home=/home/jsmith/confluence-data/
    

5. Check the Ports

If you have another application running on your machine which is using the same ports that Confluence uses by default, you may need to change the port which Confluence will use. For example, if you have a JIRA application running on this machine, JIRA might be already using the port which Confluence requests by default.

By default, Confluence listens on port '8090'. If this port is already in use in your installation, follow these instructions to change the ports:

  • To change the ports for Confluence, open the file conf/server.xml under your Confluence Installation directory. The first four lines of the file look like this:
    Default conf/server.xml
    <Server port="8000" shutdown="SHUTDOWN" debug="0">
        <Service name="Tomcat-Standalone">
            <Connector className="org.apache.coyote.tomcat4.CoyoteConnector" port="8090" minProcessors="5" maxProcessors="75"
                enableLookups="true" redirectPort="8443" acceptCount="10" debug="0" connectionTimeout="20000" useURIValidationHack="false"/>
            ...
    

    You need to modify both the server port (default is 8000) and the connector port (default is 8090) to ports that are free on your machine. The server port is required by Tomcat but is not user facing in any way. The connector port is what your users will use to access Confluence, eg in the snippet above, the URL would be http://example.com:8090.


    (tick) Hint: You can use netstat to identify free ports on your machine. See more information on using netstat on Windows or on Linux.

    For example, here are the first four lines of a modified server.xml file, using ports '8020' and '8099':

    Modified conf/server.xml using ports 8020 and 8099
    <Server debug="0" shutdown="SHUTDOWN" port="8020">
        <Service name="Tomcat-Standalone">
            <Connector className="org.apache.coyote.tomcat4.CoyoteConnector" port="8099" minProcessors="5" maxProcessors="75"
                enableLookups="true" redirectPort="8443" acceptCount="10" debug="0" connectionTimeout="20000" useURIValidationHack="false"/>
            ...
    

    To access Confluence in this configuration, point your web browser to http://localhost:8099/.

    Final Configuration

    • If this is the URL your users will use to access Confluence, update your Base URL to point to the new URL.

    • You should also ensure at this point that if you are using a firewall, it is configured to allow http/https traffic over the port you have chosen. 

You will find more information on this page.

6. Select an External Database

This step is optional for users evaluating Confluence. However, if you are installing Confluence for production purposes, this step is mandatory. Please refer to the database requirements listed on our System Requirements topic for help in choosing an external database.

(info) External databases are those listed on our Supported Platforms topic, excluding HSQLDB, which is bundled with Confluence and should not be used in production.

When you have chosen your external database, follow the appropriate database setup guide to set up your database to work with Confluence.

You can learn more about migration from an existing installation or use of the evaluation database here. You will continue to use the Database Setup Guide during the Confluence Setup Wizard. (See step 8 below.)

7. Start Confluence

  1. Go to your Confluence Installation directory (created when you unzipped Confluence — see above).
  2. Under your Confluence Installation directory, open the bin directory and run the startup script: start-confluence.sh.
  3. Once Confluence is running, open a web browser and visit http://localhost:8090/.
    (tick) Hint: If you changed the port earlier, use the port you specified in step 6 above.

8. Confluence Setup Wizard

The Confluence Setup Wizard should appear in your web browser, prompting you to enter your license key. Follow the instructions on the screens, and read more guidelines on the Confluence Setup Wizard.

Related Topics

Change listen port for Confluence
Running Confluence Over SSL or HTTPS
Confluence Setup Guide
Configuring Confluence

Last modified on Feb 24, 2016

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.