Set up Oracle XE with Docker container and connect with DBeaver

Tags: oraclesql

Today we will learn how to set up Oracle database server with Docker Linux container. This example can be applied to both Windows, Mac and Linux machine.

We will start with buiding Oracle database server image and then luanch a new container that has a running Oracle server inside. Finally we will connect the database server with GUI tool DBeaver.

Let's get started.

Build Oracle Docker image

For Windows users, you can use Linux subsystem or Git Bash command line tool. In this example, I will use Git Bash and you can install it by following command.

$ choco install git

You need to have choco installed to use the choco install command

Next lanch Git Bash shell and clone Oracle Docker project.

$ git clone [email protected]:oracle/docker-images.git 

Form the current working directory, CD to docker-images/OracleDatabase/SingleInstance

$ cd docker-images/OracleDatabase/SingleInstance/dockerfiles

Use ls command and you fill find list of folder and script.

$ ls  18.3.0/  18.4.0/  19.3.0/*

Then copy Oracle XE setup file to the folder matched with the version you downloaded. In this example, copy the setup file to folder.


Build the image with script. For Unix users, you may need prefix sudu command or allow exection permission to script.

$ ./ -v -x


  • -v is Oracle database version to build
  • -x to create an image based on 'Express Edition'

Wait for several minutes unit it's done and you will get the following messages:

 Oracle Database Docker Image for 'xe' version is ready to be extended:

    --> oracle/database:

  Build completed in 84 seconds.

If you run docker image ls, you will find a new image oracle/database with tag

Lanch Docker Oracle database server container

Use docker run command to lanch a new container with oracle/database: image.

$ docker run --name OracleXE \
--shm-size=1g \
-p 1521:1521 \
-p 8081:8080 \
-e ORACLE_PWD=12345 \
-v oracle-data:/u01/app/oracle/oradata \

Learn more about parameters

Note: The ORACLE_SID for Express Edition is always XE and cannot be changed, hence there is no ORACLE_SID parameter provided for the XE build. Wait for serveral minutes unitil it's done and you will get the following message.


Righnt now, Oracle database server is ready to use.

Connect with DBeaver

When we launch the container with docker run, we specifed host's port to1521 and password to 12345. We will use these information to connect to a server with DBeaver.

Download DBeaver

!!! To use DBeaver, you need to have Java (JDK) 8+ or AdoptOpenJDK 11 installed on your computer.

Launch DBeaver

Create a new Oracle connection and fill the following information.

  • Host: localhost
  • Port: 1521
  • Database: XE
  • Use SID
  • User name: SYS
  • Role: SYSDBA
  • Password: 12345

You may need to edit a driver. For editing the driver you can follow the steps in the following image and download the driver from Oracle Database 11g Release 2 ( JDBC Drivers

Enter image description here

Save the connection and connect to the dataase server. You can now query data from Oracle database server as the following

Enter image description here