This guide was created on a Windows XP Service Pack 3 machine. Please check the Known Issues for PostgreSQL before you start.

Installing PostgreSQL, Creating a User, and Creating a Database


  1. Obtain the PostgreSQL One Click Installer for Windows. Save it to your desktop.

  2. Double click on the installer.



  3. Choose an Installation Directory.



  4. Choose a Data Directory.



  5. Choose a password.



  6. Select the port.



  7. Choose a Locale.



  8. Click 'Next'.



  9. Wait for the installation to complete.



  10. Skip Stack Builder.



  11. Here's where to start the Admin tool.



  12. Enter a password.



  13. Make a new user.



  14. Enter a name and password.



  15. Create a new database.



  16. Assign DB Owner permissions.

Setting up Confluence to use the PostgreSQL Database


At this point, you will need to download a JDBC driver from the PostgreSQL website for use with Confluence You'll need the JDBC3 driver if you're using JDK 1.4 / JDK 1.5 and the JDBC4 driver for JDK 1.6.

Windows renames .jar extensions to .zip! Just rename it back to .jar. You'll have to set your folder options to view hidden file extensions if you can't rename it without changing the file type (Tools >> Folder Options >> View >> Uncheck "Hide Extensions for known file types."

If the server that is hosting the PostgreSQL database is not the same server as Confluence, then please ensure that the confluence server can contact the database server and also refer to the PostgreSQL documentation on how to set up pg_hba.conf If the pg_hba.conf file is not set properly, remote communication to the PostgresSQL server will fail.

  1. Download Confluence Standalone, unzip it. (The directory into which you unzipped the Confluence installation is called the Confluence Installation directory. Next you will define the Confluence Home directory.)

  2. Follow Step 4 of the standard install guide - Define your Confluence Home Directory.

  3. Place the JDBC Driver into the <confluence-install-path>/confluence/WEB-INF/lib folder.

  4. Start Confluence and after entering your license code on the 'Confluence Setup Wizard' page, click 'Custom Installation'.



  5. On the 'Choose a Database Configuration' page, select 'PostgreSQL' and click 'External Database'.



  6. Click 'Direct JDBC'.



  7. Enter your PostgreSQL database setup details (defined above) as indicated below.

Running SQL Queries

For ongoing maintenance of your server, you can continue to use PGAdmin as your SQL browser.

Troubleshooting


If you are unable to connect to the database from Confluence and they are on different machines, most likely you have a firewall in between the two machines or your pg_hba.conf file is misconfigured. Verify that your firewall is set to allow connections through 5432 or double check your hba configuration

If Confluence is complaining that it's missing a class file, you might have forgotten to place the jdbc driver in the WEB-INF/lib folder or possibly have placed it in the wrong folder.

If none of the above describes your issue, please create a support ticket at http://support.atlassian.com and be sure to include your logs (found in confluence-install/logs and confluence-data/logs).