This documentation relates to uPortal 4.0
If you are using a different version, please click on "Click for all versions" on the left side of the page and select the relevant version.

Building and Deploying uPortal

Skip to end of metadata
Go to start of metadata
All Versions
Page not found
Table of Contents
Page not found

Building and Deploying Instructions for:


uPortal Full-Source Version

Download the latest version of uPortal from the downloads page



After you have downloaded uPortal, unpack the uPortal source outside the Tomcat container (i.e., /usr/local/src or any directory outside tomcat)

tar -xvf uPortal-4.0.x.tar.gz

Now, we can configure your uPortal for deployment

Step 1: Configure the file

The uPortal build requires a file describing the deployment environment to be available in the root of the uPortal project.

     1. Go to your uPortal source directory and create the file by copying the file to


     2. Open the for editing and configure the "server.home" property to point to the root directory of your Tomcat installation.

##### Replace server.home with the location of Tomcat 6 on your machine #####
# path to tomcat binaries

Step 2: Configure filters     

     1. In the filters folder, locate the default file and configure the Database Connection Settings, uPortal Server Configuration Properties,  CAS Server Configuration, Logging information, and LDAP settings. Replace localhost:8080 with your server name. Starting with uPortal 4.0.10, uPortal provides an optional mechanism to override these settings with a file that is completely outside uPortal source. This approach allows systems administrators to change these settings without rebuilding.  It also provides an easy way for adopters to keep sensitive information outside of their Source Code Management system (See Properties Files and Properties Overrides).


## HSQL Configuration

## Database Connection Settings (Uncomment the Maven Filters section in${}/uPortal
# uPortal server configuration properties

# CAS server configuration properties

# Log4J values applied to portlets and portals.  See file
# in WEB-INF or resources directory for each portlet. This provides a
# single point of control for most logging.
# Directory to place portal and portlet log files into.${catalina.base}/logs
# Assume a DailyRollingFileAppender is used. Set the pattern to daily log-file roll-overs.
# Can also set to hourly, weekly, etc.  Use yyyy-MM-dd-HH for hourly.
# See
# Pattern to specify format of each log file entry.  See [%t] %c{2}.[%x] %d{ISO8601} - %m%n [%thread] %logger{36} %d{ISO8601} - %msg%n

# LDAP server connection settings (optional)
# To connect to LDAP, provide your connection information here and uncomment one 
# or both integration beans in uportal-war/src/main/resources/properties/contexts/ldapContext.xml

By default, uPortal 4 uses the filter file, but you can create your own filter file and build/deploy uportal using a flag for selecting the desired filter file. 

For example, I can create a new filter file named and set all my servers to point to test servers. Then, when I build and deploy uPortal I can use the flag, -Denv=test . Note, that you use the part of the file name before .properties when using the flag. This flag applies to both ant and maven. 

Make sure you use the clean command when making a switch between filters. (See example commands below)
ant clean deploy-ear -Denv=test
mvn clean install -Denv=test

Step 3: Configure your database.

Aside from entering your database server information in the filter file from Step 2, there are additional database configurations that may need to be performed. Find your selected database below and follow the steps for database-specific instruction:

Step 4: Tomcat Reminder

Just in case you missed it, don't forget to do the following configuration in your Tomcat installation

  • Shared Libraries

    • uPortal places libraries in CATALINA_BASE/shared/lib The default Tomcat 6.0 download does not enable libraries to be loaded from this directory. To resolve this you must edit CATALINA_BASE/conf/ and change the line that begins "shared.loader=" to the following:


Enabling shared libraries in CATALINA_BASE/conf/
<!-- In older versions prior to uPortal 4.0.10 --> 
<!-- In uPortal 4.0.10+, shared/classes is NOT necessary: ->
  • Shared Sessions

    • Jasig portlets, as well as many other popular JSR-168 portlets, rely on the ability to share user session data between the portal web application and portlet applications. To enable this feature:
      • Tomcat 6.0: add the emptySessionPath="true" parameter to the in-use connector (configured in Tomcat in CATALINA_BASE/conf/server.xml).
      • Tomcat 7.0 (for uPortal 4.0.10+):  add the "sessionCookiePath="/" to CATALINA_BASE/conf/context.xml.


Example Tomcat 6.0 Connector Configuration
<Connector port="8080" protocol="HTTP/1.1"
    connectionTimeout="20000" redirectPort="8443" emptySessionPath="true"/>
Example Tomcat 7.0 Connector Configuration
<Context sessionCookiePath="/">



JVM Heap Configuration

uPortal requires a larger than standard PermGen space and more heap than may be allocated by default. A good conservative set of heap settings are "-XX:MaxPermSize=300m -Xmx1024m". To add these follow the directions for your OS:

On Windows
Edit the file $TOMCAT_HOME\bin\startup.bat and insert or alter the following line, substituting for the desired values:
set CATALINA_OPTS=-XX:MaxPermSize=300m -Xmx1024m

The line you add should go just before the line starting call “%EXECUTABLE%”…

On Linux/Unix/OS X
Edit the file $TOMCAT_HOME/bin/ and insert the following line, substituting for the desired value, eg. Bash Shell:
export CATALINA_OPTS=”-XX:MaxPermSize=300m -Xmx1024m”

Step 5: Deploy uPortal

WARNING: Running the following command will reinitialize your database by dropping all tables first. Your content will be lost if you run against an existing database.

  • Run the following command to deploy uPortal and load your database

ant initportal

Step 6: Restart Tomcat


Step 7: Access uPortal

  • Replace localhost:8080 with your configured server path

If everything has been installed correctly you should see the out-of-the-box uPortal screen below


uPortal Quick-Start

Step 1: Untar the package

After downloading the uPortal quickstart version untar the package as follows

tar -xvf uPortal-4.x-quick-start.tar.gz

Step 2: Set up JAVA_HOME

Make sure the JAVA_HOME environment variable is set

 export JAVA_HOME=/path/to/java

Step 3: Startup uPortal

Start uPortal by running the ant command from inside the uPortal-4.x-quick-start directory

ant start

Environment variable conflicts

If your quick start build fails, verify you do not have CATALINA_OPTS or JAVA_OPTS environment variables set with values that might cause the build or execution to fail.

Step 4: Access uPortal


If everything has been installed correctly you should see the out-of-the-box uPortal screen below

Step 5: Stop uPortal

ant stop

For detailed instructions, read the README.txt file located in the uPortal-4.x-quick-start directory.

Ant build and deployment tasks

Ant Command



This target will test your database configuration from the command-line (not present in quick-start)


The target that will deploy uPortal and load your database, but you must first set up the JDBC properties in and set up the path to your servlet container in

The "initportal" target runs all the targets necessary to deploy the portal and prepare the portal database: bootstrap, deploy-ear, db, pubchan, i18n-db.

*IMPORTANT* Do not run this task against a database the contents of which you care about, as it initializes the database by first dropping all tables.


The "deploy-war" target first makes sure everything is compiled and up-to-date and then copies the extracted uPortal Web Application Archive (WAR) to the location required by your servlet container as specified in


The "deploy-ear" target first makes sure everything is compiled and up-to-date and builds an Enterprise Application Archive (EAR) composed of the uPortal WAR and the WARs of all the portlets being deployed. The EAR is then extracted to the location required by your servlet container as specified in


The "deployPortletApp" target runs the portlet Deployer tool. This tool takes a portlet WAR file, rewrites the web.xml file and deploys the results to the servlet container.

Example: "ant deployPortletApp -DportletApp=C:/TEMP/myPortlet.war"


The "hsql" target starts an HSQLDB server instance consistent with the default data access configuration of uPortal. Note that this Ant target does not return in a normal execution – the Ant "build" kicks off the database server but then just keeps on running. You'll need to kill it manually, e.g. via control-C or via a stop build control in your IDE.

Additional References

Having problems with these instructions?

Please send us feedback at

  • No labels