Beginner's Guide: Deploying Node.js on AWS Elastic Beanstalk with GitHub Actions

Practical guide in Spanish to deploy a Node.js app on AWS Elastic Beanstalk and configure CI/CD with GitHub Actions for testing and continuous deployment.

sábado, 16 de agosto de 2025 • 6 min read • Q2BSTUDIO Team

Artificial-Intelligence-

Automating application deployment saves time and improves the development workflow. In this practical guide in Spanish, you will learn to deploy a Node.js application on AWS Elastic Beanstalk and configure a CI/CD pipeline with GitHub Actions so that every time a push is made to the main branch, the code is tested and deployed automatically.

What is AWS Elastic Beanstalk: Elastic Beanstalk is an AWS service that facilitates the deployment and management of applications in the cloud. It allows you to upload your application and abstracts capacity provisioning, load balancing, auto-scaling, and application health monitoring.

Why use Elastic Beanstalk: it simplifies infrastructure, facilitates scalability, and can be cost-effective by leveraging the AWS free tier for simple applications.

What is GitHub Actions: GitHub Actions is a CI/CD platform that allows you to automate build, testing, and deployment. With Actions, you create workflows that can run on a push or pull request and contain jobs and steps that run on managed runners.

Typical workflow structure: an event that triggers the workflow, jobs that group steps, and steps that run specific commands. In this guide, we will use a test job and a deploy job.

Prerequisites: an AWS account with an IAM user with permissions for Elastic Beanstalk, a GitHub repository with the Node.js application code, and Node.js version 18 or higher installed locally.

Step 1 Configure the Node.js application: to get started quickly, you can clone a sample repository with Express and TypeScript. From the terminal, run git clone https://github.com/samowolabi/nodejs-elastic-beanstalk-with-githubactions-app.git and then cd nodejs-elastic-beanstalk-with-githubactions-app. Install dependencies with npm install. The typical project structure includes the .github/workflows folder with the workflow file, src with the source code, test with tests, package.json, and tsconfig.json.

Step 2 Create the environment in Elastic Beanstalk: in the AWS console, search for Elastic Beanstalk and create a new application. Assign a descriptive name and select the appropriate Node.js platform, for example Node.js 18 or higher. For simple deployments, use the Single instance preset if you want to stay within the free tier during testing.

Configure service access: Elastic Beanstalk needs a service role and an instance profile. If they do not exist, you can create a new service role named aws-elasticbeanstalk-service-role and an instance profile for EC2 instances that includes policies such as AWSElasticBeanstalkWebTier. These actions are performed from the Elastic Beanstalk console and the IAM console.

Review and launch: once the role and instance profile are configured, you can skip advanced settings and launch the environment. AWS will take a few minutes to create the resources, and when ready, you will see a public URL with the sample application.

Environment variables: if your application needs variables, configure them in the Elastic Beanstalk console under Configuration > Software > Edit and add key-value pairs such as NODE_ENV with value production. Elastic Beanstalk automatically injects the PORT variable.

Step 3 Configure CI/CD with GitHub Actions: for GitHub Actions to deploy to your AWS account, you need credentials with an access key and secret key. In the IAM console, select the corresponding user and create an access key in Security credentials, selecting Third party service if prompted. Copy the Access key ID and Secret access key at the time of creation because the secret will not be shown again.

Add credentials to GitHub: open your repository on GitHub and go to Settings > Secrets and variables > Actions. Create new repository secrets named AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY with the values obtained from AWS. These secrets will be used by the GitHub Actions workflow to authenticate with AWS.

Description of the CI/CD workflow: the typical workflow runs tests on multiple Node.js versions, for example 18.x and 20.x. The test job checks out the code, sets up Node.js with actions/setup-node, installs dependencies with npm ci, runs npm test, and builds with npm run build. The deploy job depends on the test job and only runs on push to the main branch. In deploy, it checks out, installs Node.js, installs dependencies, builds, creates a zip package excluding unnecessary files, and uses an action like beanstalk deploy to upload deploy.zip to Elastic Beanstalk. It is important to update application name, environment name, and region to match your Elastic Beanstalk environment.

Step 4 Deploy the application: make the changes you need, commit, and push to main with git add . git commit -m "feat: setup CI/CD" and git push origin main. From the Actions tab on GitHub, you can monitor the workflow execution and review the logs of the test and deploy jobs. When the deploy job finishes, open the URL of your Elastic Beanstalk environment and you should see the response from your application.

Troubleshooting common issues: if the deployment fails, check that the AWS credentials in GitHub Secrets are correct and that the IAM user has permissions such as elasticbeanstalk, s3, ec2, iam:PassRole, and logs. For build or test errors, run npm test and npm run build locally. Review the logs in GitHub Actions and in Elastic Beanstalk Logs > Request Logs > Last 100 Lines for environment-specific errors.

Best practices: keep dependencies updated, limit IAM user permissions to what is strictly necessary when possible, use environment variables for sensitive credentials, and enable monitoring and alarms in AWS for production.

About Q2BSTUDIO: at Q2BSTUDIO, we are a custom software and application development company specialized in solutions tailored to each client's needs. We offer custom software, custom applications, and comprehensive services that include artificial intelligence, cybersecurity, AWS and Azure cloud services, and business intelligence services. Our teams design AI solutions for businesses, develop custom AI agents, and create dashboards with Power BI to gain insights and improve decision-making.

Featured services from Q2BSTUDIO: custom application development for web and mobile, integration of artificial intelligence and AI agents to automate processes, consulting and deployment of AWS and Azure cloud services, implementation of cybersecurity strategies, and business intelligence solutions with Power BI. All this with agile methodologies focused on results and scalability.

Why choose Q2BSTUDIO: we combine technical expertise in custom software development and knowledge in artificial intelligence with security practices and cloud deployment. We help companies transform data into real value through business intelligence services, protect their assets with cybersecurity, and optimize operations with AI solutions for businesses and AI agents that automate repetitive tasks.

Keywords for positioning: custom applications, custom software, artificial intelligence, cybersecurity, AWS and Azure cloud services, business intelligence services, AI for businesses, AI agents, Power BI. We recommend including these keywords on service pages and in technical articles to improve visibility and SEO.

Conclusion: deploying a Node.js application on Elastic Beanstalk and automating the process with GitHub Actions is an effective way to reduce human errors and speed up deliveries. With proper configuration of roles in AWS, the use of secrets in GitHub, and a well-defined testing workflow, you can ensure repeatable and reliable deployments. If you need help implementing this solution or want a custom platform that leverages artificial intelligence, cybersecurity, and cloud services, at Q2BSTUDIO we can accompany you from design to deployment and continuous monitoring.

Contact and next step: if you want Q2BSTUDIO to implement a CI/CD pipeline, integrate artificial intelligence solutions, or improve security and scalability on AWS or Azure, contact our team for a personalized consultation and discover how to transform your project with custom software and business intelligence services with Power BI.

OUR SERVICES

How we can help you

Do you have a project in mind?

Tell us your vision and we'll turn it into a software solution. Whatever the scope, we make your idea real.