This project automates the deployment of a ThingsBoard server on an AWS EC2 instance using Terraform. It includes provisioning AWS resources such as an EC2 instance, a PostgreSQL RDS database, and security groups, along with installing and configuring ThingsBoard.
- Automates the deployment of ThingsBoard on Ubuntu EC2
- Provisions PostgreSQL RDS instance for ThingsBoard
- Configures Nginx as a reverse proxy for ThingsBoard
- Security group rules for SSH, HTTP, MQTT, CoAP, and ThingsBoard ports
- Easy-to-use Terraform scripts
- AWS Account: Ensure you have access to an AWS account.
- Terraform: Install Terraform on your machine. (Download Terraform)
- AWS Credentials: Configure your AWS CLI with proper credentials.
aws configure
- Key Pair: Ensure you have an AWS key pair for SSH access (e.g.,
vockey.pem).
Clone this repository to your local machine:
git clone https://github.com/wajidengg/thingsboard_project.git
cd thingsboard_projectUpdate the variables.tf file with your values:
subnet_id: Set the Subnet ID for your VPC.db_password: Provide a secure password for the PostgreSQL database.
Alternatively, pass these variables during the terraform apply command.
Initialize Terraform to download required providers:
terraform initRun the following command to deploy the infrastructure:
terraform applyProvide any required variable values if prompted.
- Once Terraform completes, it will output the ThingsBoard URL. Example:
http://<public-ip>:8080 - Open the URL in your browser to access the ThingsBoard UI.
- Use the default login credentials:
- Username:
tenant@thingsboard.org - Password:
tenant
- Username:
The following ports are opened in the security group:
- 22: SSH
- 80: HTTP
- 8080: ThingsBoard UI
- 1883: MQTT
- 5683: CoAP
To destroy the infrastructure, run:
terraform destroy- SSH Connection Issues: Ensure the correct key pair is used and the security group allows inbound SSH traffic on port 22.
- ThingsBoard Access: Verify the public IP is accessible and the security group allows inbound HTTP traffic on port 8080.
This project is licensed under the MIT License.