Whether you’re a developer, freelancer, or small business owner, learning how to host a website on a Linux server gives you full control, scalability, and cost-efficiency. In this guide, weâll walk you through hosting your own website on a Linux VPS or dedicated server â from setup to deployment.
This process is 100% hands-on and ideal for anyone using platforms like VavenCloud, where Linux servers are the backbone of custom web hosting.
đŚ Prerequisites
Before we dive in, hereâs what youâll need:
A Linux-based server (Ubuntu 20.04+ is recommended)
Root or sudo access
A registered domain name
Basic knowledge of terminal commands
SSH client (like PuTTY or your terminal)
1. đ Connect to Your Linux Server via SSH
From your local machine, open a terminal and connect to your server:
ssh username@your_server_ip
Replace username (often root) and your server’s IP. If this is your first time, youâll be prompted to accept the SSH key and enter your password.
2. đ§š Update Your System Packages
Keep your server secure and up-to-date:
sudo apt update && sudo apt upgrade -y
This ensures all software packages are current and vulnerabilities are patched.
Auto-renewal is set up by default, but you can verify with:
sudo certbot renew –dry-run
7. đ Final Test
Open your browser and navigate to your domain (e.g. https://yourdomain.com). Your website should be live, secure, and running on your Linux server!
đ Bonus: Automate with VavenCloud
Manually hosting is a great learning experience â but if you want to speed up deployments, scale effortlessly, and add CI/CD out of the box, VavenCloud can automate much of this setup.
With VavenCloudâs DevOps suite, you get:
Pre-configured Linux VPS
One-click website deployment
Built-in SSL, backups, and domain tools
Git-based CI/CD pipelines for automatic publishing
đ§ Final Thoughts
Hosting a website on Linux from scratch teaches you the building blocks of web infrastructure â something every developer should try at least once. But when itâs time to go from DIY to production-grade, platforms like VavenCloud help you scale securely, reliably, and without hassle.
Want to try VavenCloudâs hosting platform?
đ Get started here
Are you running a small or medium enterprise and looking for a way to integrate your essential business processes? ERPNext, a free and open-source Enterprise Resource Planning (ERP) solution, can streamline your operations by centralizing and automating key functions. This guide will walk you through the step-by-step process of installing ERPNext on your Ubuntu server, unlocking enhanced efficiency and productivity for your team.
What is ERPNext?
ERPNext is a robust, open-source ERP platform designed to simplify and automate business operations. It offers integrated tools for accounting, inventory management, customer relationship management (CRM), human resources, and project management. By centralizing data, providing real-time insights, and enabling seamless collaboration, ERPNext is a flexible and cost-effective solution for businesses of all sizes.
Prerequisites
Ubuntu Server:Â A fresh installation of Ubuntu 22.04.
Hardware:Â Minimum 2 CPU cores, 4GB RAM, and 20GB SSD storage (SSD recommended for best performance).
Timezone:Â Ensure your serverâs timezone matches your location. Check with:
date
If needed, update the timezone:
sudo timedatectl set-timezone "TIMEZONE"
Replace TIMEZONE with your region, such as Asia/Kolkata or Europe/Copenhagen.
Step-by-Step Installation
1. Update System Packages
Start by updating all existing packages:
sudo apt-get update && sudo apt-get upgrade -y
2. Create a New User
Replace yourusername with your preferred username:
sudo adduser yourusername
sudo usermod -aG sudo yourusername
su yourusername
cd /home/yourusername/
This helps keep your system secure by avoiding root user exposure.
3. Install Essential Packages
Fail2ban:Â Protects your server from unauthorized access:
sudo mysql_secure_installation
Answer the prompts as needed, except for âDisallow root login remotely?ââselect N to allow remote access if required.
Edit the MySQL configuration file:
sudo nano /etc/mysql/my.cnf
Add the following lines at the end:
[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
[mysql]
default-character-set = utf8mb4
Save and restart MySQL:
sudo service mysql restart
5. Install Frappe Bench
Frappe Bench is a command-line tool for managing ERPNext installations:
bench --site mysite.local enable-scheduler
bench --site mysite.local set-maintenance-mode off
8. Set Up NGINX and Security
Configure NGINX:
bench setup nginx
sudo supervisorctl restart all
If you encounter deprecated Ansible playbook entries, update /usr/local/lib/python3.10/dist-packages/bench/playbooks/roles/mariadb/tasks/main.yml by replacing – include with – include_tasks.
Conclusion
By following these instructions, you will have a fully operational ERPNext instance running on your Ubuntu server, ready to streamline your business operations. Take time to explore ERPNextâs features and customize them to fit your organizationâs needs.
Mastodon is a decentralized social network comprised of separate servers focused on specific themes, topics, or interests. Users can join these servers, follow others, engage in conversations, and perform activities similar to what you’d typically do on platforms like Twitter.
Mastodon has been in existence since March 2016, but it gained significant popularity in late 2022, thanks to a notable acquisition of a particular social media platform.
A Mastodon website can function independently, much like a regular website. Users sign up, post messages, share pictures, and have conversations, similar to what you’d expect on any website. However, unlike traditional websites, Mastodon websites can connect and interact with each other. This means that users from different Mastodon websites can communicate, much like how you can send an email from your Gmail account to someone using Outlook, Fastmail, Protonmail, or any other email service, as long as you have their email address. In the same way, you can mention or send messages to anyone on any Mastodon website if you know their username or address.
Mastodon vs. Twitter: Exploring the Differences in Social Media Platforms
In the world of social media, Mastodon stands out because it’s all about people having control and being part of a community. It’s not like Twitter, which is really popular but has some problems like keeping your data private and not being clear about how its rules work.
Mastodon is different. It’s like a friendly neighborhood where everyone helps make the rules. On Twitter, special computer rules decide which posts you see first, which can make you only see similar things and never have a real conversation. But on Mastodon, you see posts in the order they were made, which makes it open and friendly.
What’s more, on Mastodon, you can even make your own neighborhood and have your own rules. You and your neighbors decide what’s okay and what’s not. This makes Mastodon a unique and user-friendly social place.
The Benefits of Hosting Your Own Instance
When it comes to Mastodon, you have choices: join an existing group or start your own. Let’s break it down. Joining an existing group is like moving into a ready-made neighborhood; you’re part of a community right away. But you can’t customize much. On the other hand, having your own group has lots of benefits. You’re the boss; you can make it look and work as you like. You decide the rules, creating a cozy place for you and your friends. Your data is yours, so privacy is no problem.
Creating Your Own Mastodon Server
Before you start your own Mastodon community, remember a few things. You’ll need a server or instance. Also, you must have a proper domain. You can get a domain from any domain provider, and they offer different servers, too. The server you choose depends on how many people will use your Mastodon and how active it is. If you want more options, they have different server configurations too.
Pre-requisites
A computer running Ubuntu 20.04 or Debian 11, where you have full administrative access (root access).
Choose a domain name (or subdomain) for your Mastodon server, for example, example.com.
An email delivery service or another SMTP server.
Creating a mastodon System User and granting it administrative privileges
To begin, go to the root and create your Mastodon user using the ‘adduser’ command.
sudo su -
adduser mastodon
Following that, add your Mastodon user to the sudo group to provide it with administrative privileges:
usermod -aG sudo mastodon
Setting Up Mastodon: Installing Dependencies and Cloning the Repository
Before proceeding, ensure that you have installed curl, wget, GnuPG, apt-transport-https, lsb-release, and ca-certificates.
To use yarn, activate Node.js’s corepack, which is included by default.
corepack enable
Yarn has two distinct development paths, one being version 1.0 (known as classic), and the other being version 2.0. Mastodon specifically needs the classic version of yarn. You can enable this classic version using the command: “yarn set version”.
yarn set version classic
Installing Ruby
To make managing Ruby versions simpler and more efficient, we’ll use rbenv. With rbenv, it’s easier to obtain the correct Ruby versions and update them when new releases become available. However, it’s important to note that rbenv must be installed for a specific Linux user. Therefore, the first step is to create the user that Mastodon will run as.
If you find the new version of Gem use this command to install
gem update --system 3.4.20
Setting up PostgreSQL
You should create a PostgreSQL user for Mastodon. In a basic setup, the simplest approach is to use “ident” authentication. This means that the PostgreSQL user doesn’t have a separate password and can be accessed by the Linux user with the same username.
sudo -u postgres createuser --interactive
Output
Enter name of role to add: mastodon
Shall the new role be a superuser? (y/n) y
Setting up Mastodon
To obtain the latest stable release of Mastodon, use Git to download the code.
cd /home/mastodon/
git clone https://github.com/mastodon/mastodon.git live
cd live
bundle config deployment 'true'
bundle config without 'development test'
bundle install -j$(getconf _NPROCESSORS_ONLN)
yarn install --pure-lockfile
The two “bundle config” commands are necessary only during the initial dependency installation. If you plan to update or reinstall dependencies at a later time, you can simply use “bundle install.”
Please enter your domain name. make sure your input is accurate because changing it later can be challenging.
Mastodon offers a single-user mode where registrations are disabled. If your goal is to create a shared space with others, it’s important not to enable the single-user mode.
Your instance is identified by its domain name. Changing it afterward will break things.
Domain name: example.com
Do you want to enable single user mode? (y/N) N
Are you using Docker to run Mastodon? (Y/n) N
During the PostgreSQL setup, you can keep all the settings as their defaults by simply pressing Enter for each prompt. Your database doesn’t rely on a password for authentication; instead, it uses peer authentication, which we’ll explain further later on. For now, you can leave these settings empty.
PostgreSQL host:(/var/run/postgresql) /var/run/postgresql
PostgreSQL port: (5432) 5432
Name of PostgreSQL database: (mastodon_production) mastodon_production
Name of PostgreSQL user: (mastodon) mastodon
Password of PostgreSQL user:
Database configuration works!
Since this database is meant to be accessible only locally on this server, there’s no need to set up a password so, you can keep the Redis settings at their default values, and you can leave the password field empty. Just press Enter for each prompt.
In the next step, you have two options: use local storage or set up cloud storage with various providers. you’ll be prompted to decide how you want to handle file storage for Mastodon. If you prefer local storage please select “No.” if you want to store on cloud storage an immediate cloud storage solution is ready.
Do you want to store uploaded files on the cloud? (y/N) N
Mastodon needs access to an SMTP email server to send emails. Maintaining a secure and reliable email server is challenging, so an external provider is recommended. It’s best to use an external email service provider. Note that most charges are based on usage, and some offer a free tier up to a certain limit. Use your discretion in this situation.
When using email providers, you’ll need to create and configure an account. After signing up, you typically have to verify your domain by adding DNS records. You’ll also require an API key for secure authentication. The exact process varies by provider.
Do you want to send e-mails from localhost? No
SMTP server: (smtp.mailgun.org) smtp.mailgun.org
SMTP port: (587) 587
SMTP username:
SMTP password:
SMTP authentication: (plain)
SMTP OpenSSL verify mode: none
Enable STARTTLS: auto
E-mail address to send e-mails "from":mastodon<[email protected]>
Send a test e-mail with this configuration ? (Y/n)Y
Do you want Mastodon to periodically check for important updates and notify you? (Recommended) (Y/n) Y
This configuration will be written to .env.production
Save configuration? (Y/n) Y
Now that configuration is saved, the database schema must be loaded.
If the database already exists, this will erase its contents.
Prepare the database now? Yes
Running `RAILS_ENV=production rails db:setup` ...
Created database 'mastodon_production'
Done!
The final step is compiling CSS/JS assets.
This may take a while and consume a lot of RAM.
Compile the assets now? Yes
Your Mastodon server is ready, but it’s not running yet. You’ll be prompted to create an administrator account for logging into your Mastodon server.
Do you want to create an admin user straight away? (Y/n) Y
Username: (admin)
E-mail:
To check the contents of your generated Mastodon configuration file, open it using the “nano” text editor or your preferred text editor.
Open the file located at /etc/nginx/sites-available/mastodon in a text editor.
sudo vim /etc/nginx/sites-enabled/mastodon
Inside this file, replace all instances of “example.com” with your own domain name. Make any other necessary adjustments according to your configuration needs. Look for lines beginning with “ssl_certificate” and “ssl_certificate_key.” Remove the “#” symbol at the beginning of these lines to uncomment them. Then, replace the path in these lines with the correct file paths for your SSL certificate and key, which should correspond to your domain name. Save the file, after making the changes.
sudo systemctl reload nginx
Setting up systemd services
Please copy the systemd service templates from the Mastodon directory and paste in the systemd/system directory
These services will now start automatically during boot.
To access your mastodon toy need to copy your domain and search on the browser it will open your mastodon account click on login and login with the credentials you get while setting up mastodon.