Posts

Showing posts with the label Nginx

How to Deploy a Rails 7 Application with Capistrano, Nginx, Puma, Postgresql, LetsEncrypt on Ubuntu 20.04 / Amazon Linux 2

Image
What are we going to do So whenever I start a new project and want to deploy it to production, I need to research from scratch how to setup a Amazon Linux 2 (Ubuntu Server) including Firewall, how to setup Capistrano, get NGINX to work with Puma etc. That’s why I summarize everything I do to get a Project deployed. Create the Rails project Make sure you have Postgresql installed and running locally. rails - v # Rails 7.0.3 rails new mysite -- database = postgresql rake db:setup rails db:migrate rails s # rails s -b 0.0.0.0 Now you should be able to visit  http://localhost:3000  in your browser. Server Setup Ubuntu 20.04 (hetzner cloud) or Amazon Linux 2 (AWS ec2 instance). SSH Config I always make sure to select my public key when I create the server so that one is already entered in the  ~/.ssh/authorized_keys  file for the root user.  Otherwise we can generate a new key like below: # https://docs.github.com/en/authentication/connecting-t...