Prerequisites
- A Clouddley account
- An AWS account
- AWS CLI installed and configured on your local machine
- AWS Access Keys with permissions to create and manage EC2 instances
- Git installed locally
- Basic familiarity with the Linux command line
Create an AWS EC2 Instance
Create an EC2 instance to host your database. With AWS CLI, you can quickly create one. First, create a VPC and security group if you don’t want to use the default ones.- Create a VPC by running the command:

Create a VPC on AWS
- Create a security group by running the command::
Replace the
vpc_id with the one created in the previous step. 
Create a Security group on AWS
- Allow inbound traffic on port 22 (SSH) by running the command:
Replace the
sg_id with the one created in the previous step. - To create an EC2 instance, you need to have an SSH key pair. If you don’t have one, you can generate and import one below.
How to Generate and Import SSH Keys to AWS
How to Generate and Import SSH Keys to AWS
If you don’t have an SSH key pair on your local machine, follow the steps below.Press Enter to accept the default file location and choose a passphrase if you want one.
- Step 1: To generate an SSH key, run the command:
- Step 2: To add your SSH key to AWS, run:
Replace the path to your public key if it’s different.
- Finally, create the EC2 instance:
- Replace ami-xxxxxxxx with regions’s compatible AMI
- Replace my-key with your key pair name
- Replace sg_id with your security group id

Create a EC2 instance on AWS
Once the instance is running, note the Public IP address of the instance. You’ll need it later.
Deploy
Your AWS EC2 instance is now ready. Next, deploy a PostgreSQL database using Clouddley. Step 1: Access Databases- Log in to your Clouddley account.
- Navigate to the Databases on the left sidebar.
- Click on Deploy Database

Accessing Databases
Step 2: Configure your virtual machine(VM)
- In the choose or add server dropdown, select your VM if it’s listed. If not, select + Add Virtual Machine and enter your EC2 instance IP address as the VM host, along with the VM User and SSH port.
- After adding the details, verify the connection with the Clouddley CLI (recommended) or SSH.
How to Install Clouddley CLI to Verify your AWS EC2 Instance
How to Install Clouddley CLI to Verify your AWS EC2 Instance
- Open your local machine’s command line, then connect to the remote VM you want to configure with Clouddley. Use this command to SSH into your EC2 instance:
- Install Clouddley CLI by running the command:
- To add the SSH public key, run the command:
- Click Verify to check the connection.
- Once verified, click on Next.

Configure virtual machine on Clouddley
Step 3: Configure your database name
- Enter a name for your PostgreSQL database.
- Click on Next to proceed.

Defining a unique name for the PostgreSQL database
Step 4: Select your database type and version
- Choose PostgreSQL as your database type.
- Select the version of PostgreSQL you want to deploy.
Ensure you select a version that is compatible with your application requirements.
- Enable delete protection to prevent accidental deletions.
- Click on Deploy DB

Selecting the PostgreSQL database type and specifying the version
Step 5: Confirm deployment
- Once your deployment is complete, you will see a confirmation message
Deployed successfully!

PostgreSQL database successfully deployed
Step 6: Open database port on AWS EC2 instance
- Check the port Clouddley has configured for your PostgreSQL database. Then, add a new rule to your AWS security group to allow traffic for that port. For example, if Clouddley configured port
14172, run:
Replace the
sg_id with the one created earlier. Manage your database
The Database dashboard makes it easy to manage your PostgreSQL database on an AWS EC2 instance. You can deploy, monitor, and maintain your database. Here’s what you can do:- View real-time logs to check performance and troubleshoot fast.
- Reset passwords securely with built-in authentication and encryption.
- Prevent accidental deletions with built-in delete protection.
- Manage the database users and access control.

Database dashboard
Conclusion
And there you have it, your PostgreSQL database is live on AWS, running on an EC2 instance with Clouddley making deployment easier. No endless trial and error. Just a clean, reliable setup you can build on. From here, you can start plugging your database into your apps, grow as your needs evolve, and feel confident knowing you’ve set it up the right way. Got feedback or ideas to improve the experience? We’d love to hear from you. We can’t wait to see what you deploy next!Getting started with Clouddley?
A backend infrastructure for your own compute. Run apps, databases, brokers, and AI workloads on your VMs, bare metal, or VPS.
Additional Resources
Updated on September 10, 2025
