In this guide, I will walk you through the process of setting up Oracle 23c Free Database, Oracle APEX (Application Express), ORDS (Oracle REST Data Services), and Oracle SQLcl in a Docker container. While the VM Appliance comes preloaded with these tools, this guide focuses on the Docker environment for greater flexibility and ease of use.
However, you don't need to download anything now - I'll show you how to do it quickly via the command line.
If you already have Docker running, you can skip the first section about installation and proceed to the "Getting Docker to Work" section.
If you don't have Docker installed, follow the steps outlined below. The details will differ depending on your platform/OS.
Installation Steps
- For Max. First, install Brew, Colima, or Docker. You can follow the instructions in this guide.
- For Windows. The process is straightforward. Just make sure Docker is running and start Docker Desktop.
- For Unix. Install Docker using the following commands in your terminal.
Step1: Install Docker Ensure you have Docker installed on your system. you can check the version or install Docker using the following commands.:
Docker version / docker --version
# OR
sudo yum install docker -y
Step2: Pull and Run Oracle 23ai Free Database container Pull the Oracle 23ai free database docker image and run it with specific port mapping to avoid conflicts.
docker pull container-registry.oracle.com/database/free:latest
docker run -d -it --name 23cfree -p 8521:1521 -p 8500:5500 -p 8023:8080 -p 9043:8443 -p 9922:22 -e ORACLE_PWD=oracle container-registry.oracle.com/database/free:latest
docker exec -it 23cfree /bin/bash
Step3: Setup Oracle Apex Inside the container download and install Oracle Apex.
curl -o apex-latest.zip https://download.oracle.com/otn_software/apex/apex-latest.zip
unzip apex-latest.zip
rm apex-latest.zip
cd apex
Step4: Configure Oracle Apex Allow the Oracle Database to settle, then open SQL *Plus and set the PDB.
mkdir /home/oracle/software
mkdir /home/oracle/software/apex
mkdir /home/oracle/software/ords
mkdir /home/oracle/scripts
cp -r /home/oracle/apex/images /home/oracle/software/apex
su
cat /dev/null > /etc/dnf/vars/ociregion
dnf update -y
dnf install sudo -y
dnf install nano -y
nano /etc/sudoers
# in the Defaults section, add the following
Default !lecture
# Add the following at the end
oracle ALL=(ALL) NOPASSD: ALL
# This is to add oracle user in sudoes list
# so that user oracle can execute sudo command without password
save the file and exit it out.
dnf install java-17-openjdk -y
java -version
mkdir /etc/ords
mkdir /etc/ords/config
mkdir /home/oracle/logs
chmod -R 777 /etc/ords
yum-config-manager --add-repo=http://yum.oracle.com/repo/OracleLinux/OL8/oracle/software/x86_64
dnf install ords -y
export _JAVA_OPTIONS="-Xms512M -Xmx512M"
ords --config /etc/ords/config install
# Follow the configuration steps
Installation Type > Choose option [2] Enter
Connection Type > Choose option [1] Enter
host name > Enter
listen port > Enter
service name > FREEPDB1
administrator username > SYS
password > oracle
default tablespace > Enter
temp tablespace > Enter
features > Enter
Start ORDS > [1] Enter <-- Standalone Mode
protocol > [1] < http
port > [1] <-- 8080
Static Resources > /home/oracle/software/apex/images
Step7: Final Steps and Enjoy.
Exit the Docker container, restart the container, and access APEX, and install sqlCL if needed.
docker install 23cfree
# Wait 60 seconds and access APEX at localhost:8023/ords/apex
# Workspace > INTERNAL
# Username > ADMIN
# Password > the Complex Password
Now you can also install sqlCL if you want
dnf install sqlcl -y
# check if sqlcl installed properly
# sql sys/oracle as sysdba
SQL> help
SQL> exit
By following this comprehensive guide, you'll be able to run Oracle 23ai Free Database with APEX and ORDS in a Docker container, creating a flexible and scalable environment for your development needs. Enjoy the seamless integration of these powerful tools and elevate your database development experience.