Local APEX environment with docker

You will need to install docker locally. I use Docker Desktop for Mac. I am using a simple password here for the database (Welcome1) - please consider changing this when doing your own install.

This blog is really my own reminder of how to establing this local development environment. If you can use it, that’s great :-).

Install the Oracle database (free)

We get the Oracle database from Gerald Venzl:

https://hub.docker.com/r/gvenzl/oracle-free

Create a network that can be shared between the Oracle database container and the ORDS container, and then create the database container.

docker network create oranet
docker run -d -p 1521:1521 --network oranet -e ORACLE_PASSWORD=Welcome1 -v oracle-volume:/opt/oracle/oradata gvenzl/oracle-free

Install APEX

Download APEX from apex.oracle.com, and copy the zip file into the docker container. Also: make sure the database container is started before performing these steps:

docker ps
c4c19ea0bfd9   gvenzl/oracle-free  "container-entrypoin…"   11 hours ago     Up 11 hours     0.0.0.0:1521->1521/tcp, [::]:1521->1521/tcp   objective_galois

docker cp apex_24.2.zip c4c19ea0bfd9:/tmp

Open docker terminal (ex. through Docker Desktop → Containers → Actions → Open in terminal).

cp /tmp/apex_24.2.zip /opt/oracle/product
unzip apex_24.2.zip -d apex_24.2
cd /opt/oracle/product/apex_24.2/apex
sqlplus / as sysdba

SQL> alter session set container=freepdb1;
SQL> start apexins SYSAUX SYSAUX TEMP https://static.oracle.com/cdn/apex/24.2.0/

SQL>alter user apex_public_user account unlock;
SQL>start apxchpwd.sql

Optional step

Allow APEX to access any host (through APEX_WEB_SERVICE). Run the following (as SYS).

SQL>BEGIN
  DBMS_NETWORK_ACL_ADMIN.APPEND_HOST_ACE(
    host => '*',
    ace => xs$ace_type(privilege_list => xs$name_list('connect'),
    principal_name => APEX_APPLICATION.g_flow_schema_owner,
    principal_type => xs_acl.ptype_db));
END;
/

Install ORDS

ORDS needs a folder locally to persist the ORDS configuration. Navigate into the location of your choice and create a new folder. Then start creating the docker container.

mkdir ords_config
chmod 777 ords_config
docker run -d --name ords --network oranet -v `pwd`/ords_config:/etc/ords/config -e DBHOST=c4c19ea0bfd9 -e DBPORT=1521 -e DBSERVICENAME=FREEPDB1 -e ORACLE_PWD="Welcome1" -p 8080:8080 container-registry.oracle.com/database/ords:latest

(replace hostname and password with your own)

Testing the installation

Start the containers (first the database, the ORDS).

http://localhost:8080/ords/_/landing

1
Subscribe to my newsletter

Read articles from Martin B. Nielsen directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Martin B. Nielsen
Martin B. Nielsen

I am a freelance developer from Denmark, working on Oracle Platform projects - mainly Oracle Application Express (APEX).