🕵️ SicherheitslückenHak5: Hackers Just Poisoned the Rust Supply Chain | Threat Wire(01.09.2026 um 14:00 Uhr)
🕵️ SicherheitslückenHak5: Hackers Found a Way Into Humanoid Robots | Threat Wire(04.09.2026 um 15:04 Uhr)
🔧 AI Nachrichten Bits und so #1021 (Passwort für Laufwerk)(31.08.2026 um 22:15 Uhr)
🔧 AI Nachrichten Bits und so #1022 (Wie Weißbier)(06.09.2026 um 20:39 Uhr)
🍏 iOS / Mac OSHue-App 6.0 ist da: das sind die Neuerungen(07.09.2026 um 17:21 Uhr)
🕵️ SicherheitslückenHak5: Hackers Just Poisoned the Rust Supply Chain | Threat Wire(01.09.2026 um 14:00 Uhr)
🕵️ SicherheitslückenHak5: Hackers Found a Way Into Humanoid Robots | Threat Wire(04.09.2026 um 15:04 Uhr)
🔧 AI Nachrichten Bits und so #1021 (Passwort für Laufwerk)(31.08.2026 um 22:15 Uhr)
🔧 AI Nachrichten Bits und so #1022 (Wie Weißbier)(06.09.2026 um 20:39 Uhr)
🍏 iOS / Mac OSHue-App 6.0 ist da: das sind die Neuerungen(07.09.2026 um 17:21 Uhr)

🔧 Programmierung 🕛 kürzlich 4 Min Lesezeit
0

Hosting a Rails App on Ubuntu 20.04 with Nginx and Phusion Passenger: A Comprehensive Guide

↗ Quelle (dev.to)
🗣️ Stimme:
📑 Inhaltsübersicht

In today's rapidly evolving software landscape, Platform as a Service (PaaS) offerings like Heroku have gained immense popularity for their convenience and ease of use. They allow developers to deploy applications without worrying about the intricacies of server management. However, this convenience often comes at a hefty price, making it a less attractive option for developers and small businesses operating on a tight budget.



For those who prefer to maintain complete control over their application stack and want to avoid recurring PaaS costs, hosting a Rails app on a dedicated server remains a viable and cost-effective solution. Yet, finding reliable resources that guide you through the manual setup process can be daunting. This guide is designed for users who are ready to roll up their sleeves and dive into the intricacies of server management, bypassing the need for pricey service fees that come with PaaS. If you're someone who isn't afraid of getting your hands dirty and want to deploy a Rails app manually using Nginx and Phusion Passenger on Ubuntu 20.04, this detailed walkthrough is just what you need.






Step-by-Step Guide to Host Your Rails App on Ubuntu






1. Update System Packages



Start by ensuring your system is up-to-date. This is crucial for security and stability.




CODE
sudo apt update
sudo apt upgrade -y









2. Install RVM and Ruby



Ruby Version Manager (RVM) is essential for managing Ruby installations and gemsets efficiently.




CODE
sudo apt install curl gpg
curl -sSL https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
rvm install ruby
rvm use ruby --default









3. Install Rails



Once Ruby is installed, proceed to install Rails, the framework used to build your application.




CODE
gem install rails









4. Install Node.js and Yarn



Rails requires a JavaScript runtime like Node.js for its asset pipeline, and Yarn helps in managing JavaScript dependencies.




CODE
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt install -y nodejs
npm install --global yarn









5. Install MySQL (or Your Preferred Database)



Set up the database system of your choice; MySQL is used here for demonstration.




CODE
sudo apt install mysql-server libmysqlclient-dev









6. Install and Configure Nginx



Nginx will serve your Rails application to the web, providing fast and efficient delivery.




CODE
sudo apt install nginx









7. Install Passenger



Phusion Passenger is an application server that integrates seamlessly with Nginx to handle Ruby applications.




CODE
sudo apt install dirmngr gnupg
sudo apt-key adv --keyserver hkps.pool.sks-keyservers.net --recv-keys 95C1DD26C60FA986 4B2C1C7E1088DA93
sudo sh -c 'echo deb https://oss-binaries.phusionpassenger.com/apt/passenger focal main > /etc/apt/sources.list.d/passenger.list'
sudo apt update
sudo apt install libnginx-mod-http-passenger









Configuring Nginx and Passenger



Edit your Nginx configuration to enable Passenger:




  1. Open Nginx's main configuration file /etc/nginx/nginx.conf and uncomment the following line:




CODE
   include /etc/nginx/passenger.conf;







  1. Create a server block for your Rails application in /etc/nginx/sites-available/your_app_name.conf:




CODE
   server {
listen 80;
server_name your_domain_or_IP;
root /path/to/your/app/public;
passenger_enabled on;
passenger_ruby /usr/share/rvm/rubies/ruby-x.y.z/bin/ruby; # Update to your Ruby version
}







  1. Enable the site by creating a symbolic link:




CODE
   sudo ln -s /etc/nginx/sites-available/your_app_name.conf /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart nginx









SSL with Certbot



Secure your site with SSL using Certbot, which automates the process of obtaining and renewing SSL certificates.




CODE
sudo apt-get install python3-certbot-nginx
sudo certbot --nginx









Conclusion



By following these steps, you bypass the high costs associated with PaaS solutions and gain complete control over your Rails application's deployment. This approach might require a bit more effort, but the freedom and cost savings are well worth it. If full ownership of your server environment sounds appealing, this guide empowers you to host your Rails app with confidence. Enjoy the flexibility and financial freedom that come with self-hosting your applications!``

Vollständiger Original-Bericht
Ausführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
↗ Original-Artikel auf dev.to lesen
Wie bewertest du diesen Beitrag?
1 Klick Feedback
Teilen mit Netzwerk & Team:

Community-Analysen & Experten-Meinungen 0

Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.
Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf Eigene Analyse verfassen“!
Community Pulse: Relevanz-Einschätzung
1 Klick Experten-Votum
🔴 Akute Relevanz 0%
🟡 In Evaluierung 0%
🟢 Keine Auswirkung 0%
Spannende Innovation 0%
Verwandte Story-Cluster & Quellen (Vektor-KI)
Port 8095 Engine
1 Quelle
Hackers Just Poisoned the Rust Supply Chain | Threat Wire
1 Quelle
Hackers Found a Way Into Humanoid Robots | Threat Wire
1 Quelle
Bits und so #1021 (Passwort für Laufwerk)
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Hosting a Rails App on Ubuntu 20.04 with Nginx and Phusion Passenger: A Comprehensive Guide

Thematisch verwandte Begriffe: Hosting, Rails, Ubuntu, 2004 · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...