Skip to content

Instantly share code, notes, and snippets.

@amazingandyyy
Last active January 21, 2017 08:40
Show Gist options
  • Save amazingandyyy/908dc3b4e15a0c7a420113df9690c3e3 to your computer and use it in GitHub Desktop.
Save amazingandyyy/908dc3b4e15a0c7a420113df9690c3e3 to your computer and use it in GitHub Desktop.
deploy express app to AWS by eb

#1. install eb, tutorial

$ brew install awsebcli
$ eb --version

#2. start to deploy

$ eb init
$ eb create
$ eb setenv NODE_ENV=production
$ eb open

#3. set up custom domain

Domain Name & AWS 53 Management

AWS Route 53Management

  • Go here and under the Networking section, select Route 53
  • Create a hosted zone for your domain
  • In the domain name field, enter “yourdomainname.com” and make sure it is set to public.
  • Inside of your hosted zone, create a new record
  • In the name field, enter “www.yourdomainname.com” and make sure to set the type to A-IPv4 address, set the alias to yes, and then save the record

Set up domain with Namecheap

Log in to your Namecheap account

  • Select the Manage option at the right of the domain you want to set up
  • Select the Advanced DNS tab
  • For the CNAME record, change the host column to @ from www. For the value, paste in your Elastic Beanstalk environment address. You can find your address inside your Elastic Beanstalk console on AWS
  • For the url redirect set the host to www and set your domain url to “http://yourdomainname.com”

#4 use ssh to connect to ec2

ssh -i ~/Downloads/aws-es2.pem ec2-user@[public-IP]

#5. install node on a ec2 linux server

-> http://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/setting-up-node-on-ec2-instance.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment