How to deploy WSO2 API Manager on EC2 instance
In this article, I discuss the basic steps to deploy WSO2 API Manager 4.0.0, as a single node (all-in-one) deployment.
Note: You may need to follow additional guidelines such as securing ports, configuring databases, setting up other services for production deployment.
Step 1 — Create an EC2 Instance
In launch instance wizard for EC2 instances in AWS Console:
- Choose
Ubuntu Server 20.04 LTS (HVM)
as Amazon Machine Image. - Choose
c5.large
ort2.xlarge
as the Instance Type. - Skip Instance Details section.
- Set storage size to 20GiB.
- Skip Tags section.
- Change Type to
All Traffic
in current security group.
(Note that we will be using this instance for testing purposes) - Create and download a new key pair and launch the instance.
Step 2 — Configure EC2 Instance
Open terminal (or command prompt) in your local machine and setup EC2 instance using following commands.
- Login to EC2 Instance
ssh -i <path-to-key-pair-file> ubuntu@<public-ipv4-dns-address>
- Update packages
sudo apt update
- Install Java
sudo apt install default-jdk
- Set JAVA_HOME
(i)sudo nano /etc/environment
(ii) AddJAVA_HOME="/usr/lib/jvm/java-11-openjdk-amd64"
to environment file and save it
(iii)source /etc/environment
(iv)echo $JAVA_HOME
- Install Unzip
sudo apt install unzip
Step 3 — Get WSO2 API Manager on EC2 Instance
- Go to WSO2 API Manager’s download page using this link
- Download WSO2 API Manager 4.0.0 — Zip Archive into your local machine
- Copy the zip file to EC2 Instance
scp -i <path-to-key-pair-file> <path-to-downloaded-zip-file> ubuntu@<public-ipv4-dns-address>:~/
- Login to EC2 Instance
ssh -i <path-to-key-pair-file> ubuntu@<public-ipv4-dns-address>
- Extract both zip files
unzip wso2am-4.0.0.zip
Step 4 — Change Configurations
- Open
deployment.toml
file in API-M directorysudo nano wso2am-4.0.0/repository/conf/deployment.toml
- Change
hostname="localhost"
tohostname="<public-ipv4-dns-address>"
- Save and close
deployment.toml
file
Step 5 — Run WSO2 API Manager
- Start API Manager server
sh wso2-4.0.0/bin/api-manager.sh
- You can visit WSO2 API Manager portals using following links.
Publisher Portal: https://<public-ipv4-dns-address>:9443/publisher
Developer Portal: https://<public-ipv4-dns-address>:9443/devportal
Admin Portal: https://<public-ipv4-dns-address>:9443/admin
Carbon Console: https://<public-ipv4-dns-address>:9443/carbon
If you get Registered callback does not match with the provided url
error please follow the instructions in following link.
That’s it! Thanks for reading my article.