Installing LabKey server without granting the database user superuser status

Administration Forum (Inactive)
Installing LabKey server without granting the database user superuser status Brian Connolly  2010-06-17 09:44
 

NOTE: The content below pertains to using the LabKey Server with a PostgreSQL database only. It does not apply when using a Microsoft SQL Server.

In our install documentation we assume that the database user, being used by the LabKey server to communicate to the database, has superuser status.

If you are uncomfortable with granting the database user superuser status, then the instructions below can help you install the LabKey server using a user without the superuser status.

First, a little background about the privileges required of the database user used by LabKey Server. The database user only requires superuser status during the initial install. After the first installation, the LabKey Server only requires that the database user is the owner of the database. When the LabKey Server is started, if the database, specified in the configuration file, does not exist, then the LabKey Server will attempt to create the database. Thus the superuser status is only needed during the very first startup of the LabKey Server.

In order to run the LabKey server with a non-superuser database user I recommend the following: NOTE: These instructions assume you are using the postgres user (ie the database user created during the run of initdb, this user superuser status.)

  1. Using the postgres user, create a new database role named labkey with a strong password
  2. Using the postgres user, create a new database named labkey. Make sure to specify the user labkey as the owner. i.e.

    CREATE DATABASE labkey OWNER labkey;
    
  3. open the labkey.xml configuration file and in the database configuration XML node:

    • enter in the labkey as the user
    • enter in password choosen in #1
    • enter in labkey as the database
  4. Start the LabKey server.

The LabKey Server bootstrap process will happily install itself using the labkey database