Setting up your own Linux server may sound like deep expert territory at first, but with a clear step-by-step sequence, it is very manageable even for beginners. What matters is not installing as many packages as possible, but securing the fundamentals properly: SSH access, automatic updates, firewall rules, user permissions, and monitoring.
Your own server gives you full control: you decide on the software stack, performance, and security. At the same time, you carry full responsibility. Within minutes of a freshly provisioned server going online, automated bots scan the IP address and launch brute-force attacks against SSH. A clean initial setup is therefore not optional—it is an absolute must.
In this guide we show you how to set up a Linux server: from choosing the distribution through secure access and the firewall to backups and monitoring. If you would rather not do it yourself, we take over the setup as part of Set up server and VPS. For a concrete guide with Ubuntu, also read our article Setting up an Ubuntu server.
Who is your own Linux server worthwhile for?
Your own server is worthwhile when you need more control or more performance than classic web hosting offers. This applies to larger WordPress sites, shops with a lot of traffic, several projects on one system or applications with special requirements. If you only run a small website, managed hosting is usually the better choice, because you do not have to take care of maintenance and security at server level. More on this in the article VPS for WordPress.
Pros and cons at a glance
- Advantages: full control over configuration and PHP limits, free choice of software, flexible scalability, often significantly better performance per euro, and no artificial restrictions from the host.
- Disadvantages: You are responsible for updates, security and backups yourself, need basic knowledge and have to step in yourself in an emergency.
Step 1: Choose the right distribution
Linux is an operating system kernel that different distributions bundle with software into a complete system. For servers there are a few proven variants:
- Ubuntu Server (LTS): Very widespread, huge community and documentation, five years of free security updates for Long-Term Support versions (and up to ten years with Ubuntu Pro). An ideal choice for beginners and for WordPress.
- Debian: Very stable and lean, conservative with software versions. Popular with experienced administrators.
- AlmaLinux and Rocky Linux: Successors of CentOS, compatible with Red Hat, common in enterprise environments.
For most WordPress projects we recommend a current Ubuntu LTS or Debian version. What matters is that the version still receives security updates. You should not set up a system whose support has expired.

Step 2: Order and size the server
When choosing the server, four values matter: CPU, memory (RAM), storage space and location. For a single WordPress site with medium traffic, two virtual cores, four gigabytes of RAM and fast SSD storage are often enough. For shops or several sites, plan more reserve. Choose a location in Germany or the EU if your visitors are there and you value data protection.
Also check whether the provider offers snapshots, backups and a cloud firewall. That makes a lot easier. More on this in the article Cloud firewall.
Step 3: The first login and updating the system
After ordering you receive the IP address and either a password or an SSH key for the user root. Connect via SSH, for example through the terminal. The first thing you do: update the system so that known security holes are closed.
On Ubuntu and Debian you update with apt update and apt upgrade, then restart the server if needed. Afterwards enable automatic security updates, on Ubuntu via the package unattended-upgrades. This installs critical patches without you having to think about it.
Step 4: Set up users and permissions cleanly
Do not work as root permanently. Create your own user, give it sudo rights and use it for all further steps. The root account should later be blocked for SSH login. The principle behind it is called least privilege: every user and every service gets only the rights it really needs.
- Create a new user and assign a strong password or, better, a key.
- Add the user to the sudo group.
- In a second terminal, test whether login and sudo work.
- Only then disable the root login.

Step 5: Secure SSH
SSH is the front door to your server—and automated bots are knocking on it around the clock. The most important hardening measures are:
- SSH keys instead of passwords: A key pair is much more secure than any password. Create the key on your computer and store the public part on the server.
- Disable password login: As soon as the key works, PasswordAuthentication is set to no in the SSH configuration.
- Forbid root login: Set PermitRootLogin to no.
- Brute-force protection: With Fail2ban, IP addresses that try wrong credentials too often are blocked.
Back up the configuration before you change it, and test the new connection in a second window before you close the first session. That way you do not accidentally lock yourself out.
Step 6: Set up the firewall
A firewall only lets through the connections you really need. The basic principle is: block everything, allow only selectively. For a typical web server these are port 22 for SSH (restricted to your IP address only if you use a static IP or VPN—otherwise a changing home IP will lock you out), port 80 for HTTP, and port 443 for HTTPS. On Ubuntu you use the simple firewall ufw for this, and on the provider side additionally a cloud firewall.
After setup, check with a port scan from outside that only the desired ports are open. Every unnecessarily open port is an additional attack surface.
Step 7: Install web server, PHP and database
For WordPress you need a web server (Nginx or Apache), PHP in a supported version and a database (MariaDB or MySQL). Install only what you need and keep the versions up to date. Secure the database by creating a dedicated database user per application, restricting access strictly to localhost (127.0.0.1), and running the built-in hardening script mariadb-secure-installation or mysql_secure_installation.
Enable HTTPS with a free certificate from Let’s Encrypt and let it renew automatically. Redirect all traffic from HTTP to HTTPS. If you would rather manage everything with a graphical interface, read our article on Installing Plesk.
Step 8: Plan backups and snapshots
A server without a backup is a risk. Following the 3-2-1 backup rule (3 copies, 2 different storage media, 1 off-site location), plan at least two layers: provider-level snapshots of the entire server for a quick rollback before updates, and automated file and database backups (e.g., via mysqldump or WP-CLI) stored off-site on S3-compatible object storage. Test the restoration before you need it. What this looks like for WordPress in concrete terms, you can learn on our page on Backups.
Step 9: Monitoring and logs
Set up monitoring that tells you when the server or the website is not reachable. Also watch the utilization of CPU, RAM and storage. When the disk fills up, services stop, often without warning. Rotate log files so that they do not grow indefinitely, and look at the logs occasionally to detect unusual access.
Checklist for a clean server setup
- Current LTS distribution chosen
- System updated, automatic security updates active
- Own user with sudo, root login disabled
- SSH only with key, Fail2ban active
- Firewall with minimal rules, plus cloud firewall
- Web server, PHP and database current and secured
- HTTPS with automatic renewal
- Backups external and tested, snapshots set up
- Monitoring and notifications active
- Documentation of access and configuration
Typical mistakes in server setup
- Password instead of key: The most common entry point.
- Everything as root: One mistake affects the whole system.
- Open ports: Database or admin interfaces publicly reachable.
- No updates: Outdated software with known holes.
- No backup or not tested: Useless in an emergency.
- No monitoring: Outages remain unnoticed for a long time.
- Too much installed: Every additional piece of software needs care.
Do it yourself or have it set up?
If you enjoy technology and have time, your own server is a good learning environment. For productive sites that bring in revenue or inquiries, however, the setup has to be right. A one-off setup by professionals plus ongoing maintenance is often cheaper than an outage. We set up servers and VPS for you and, if you wish, also take care of the ongoing maintenance for $99 a month. Feel free to let us advise you through the free check on what suits your project.
Concrete commands and configuration: a sample sequence
To help you follow the workflow in practice, here is the typical command sequence we run on a fresh Ubuntu or Debian server. Adjust usernames and paths to match your setup and never copy commands blindly:
- Connect: Log in via SSH as root or as the user provided by the provider.
- Update the system: Update the package lists and bring all packages up to date, then restart if a kernel update was included.
- Set time zone and hostname: This makes logs and troubleshooting easier. Enable time synchronization.
- Create a user: Create a new user with adduser youruser and add them to the sudo group using usermod -aG sudo youruser.
- Store the SSH key: Put the public key in the authorized_keys file of the new user and set the permissions correctly.
- Adjust the SSH configuration: Disable password login and root login, reload the service and test in a second window.
- Enable the firewall: First allow SSH, then HTTP and HTTPS, then switch the firewall on.
- Install Fail2ban: Adopt the default configuration, enable the SSH jail.
- Install the web stack: Nginx or Apache, PHP-FPM, MariaDB. Then set up WordPress.
- Set up the certificate: Issue a certificate with Certbot, test automatic renewal.
This sequence forms a secure foundation. On production WordPress systems, further optimizations are added depending on traffic, such as PHP-FPM worker tuning, Nginx FastCGI caching, Redis object caching, or a dedicated database server.
Security in everyday operation: what remains to be done after setup
A server is not finished after setup. Security is an ongoing process. Plan fixed tasks:
- Daily: Let automatic backups run, watch monitoring.
- Weekly: Check for available updates, briefly look at the logs, check storage space.
- Monthly: Check user accounts, remove services no longer used, test restoring a backup.
- Yearly: Check the distribution and PHP version for end of support, review the configuration.
Many operators forget this routine. The result is servers that are outdated and vulnerable after two years. That is exactly why we offer ongoing care, so that nobody is left alone with a server that they eventually only touch carefully. You can find more on securing it on our page on the Security package.
WordPress on your own server: what else to keep in mind
A server with WordPress needs a few specifics. Create a separate system user for each site so that a compromised site cannot access others. Set file permissions restrictively: folders with 755, files with 644, wp-config.php as tight as possible. Switch off the file editor in the WordPress backend so that attackers cannot inject code via the backend. Use a server-side cache and pay attention to the PHP opcache, which often brings more speed than any additional plugin. For loading time itself, the measures from our Pagespeed Boost.
Understanding utilization: when the server becomes too small
Typical signs of too little performance are long response times with rising visitor numbers, errors like 502 or 504, full utilization of memory and high CPU load. Before you upgrade, check the causes: often they lie with unsuitable plugins, missing caching or unoptimized images. Only when these points are done does more hardware really help. The advantage of a VPS: you can usually expand performance with a few clicks.
How we proceed at Boudmedia
When setting up a server for customers, we work with a fixed template: hardened access, firewall, automatic security updates, backups in an external location, monitoring and short documentation that you keep. You do not get a server that only we understand, but a system that can be handed over cleanly and operated further. If you want to switch later, everything is available to you.
If you are unsure which size and which environment suit your project, write to us via the Contact page or use the free check. We will tell you honestly whether managed hosting for $21 a month is enough or whether your own server is actually worthwhile.
Network, DNS and domain connection
For your site to be reachable under a domain, you need to set DNS records. The A record connects the domain with the IPv4 address of your server, the AAAA record with the IPv6 address. For the www variant you create a CNAME record or another A record. Before a migration, lower the TTL to a low value, around 300 seconds, so that changes take effect quickly. Also set the reverse DNS record (PTR) in your provider's portal to match your hostname and configure SPF, DKIM, and DMARC records, especially if the server or WordPress sends emails. Check the records with tools like dig or nslookup and wait until the changes have spread worldwide before you shut down the old environment.
Time, locale and basic configuration
Small settings prevent big confusion. Set the time zone to your region and enable time synchronization so that log files, cron jobs and certificates work reliably. Choose the right locale for language and character set, usually UTF-8. Assign a meaningful hostname (an FQDN such as server.yourdomain.com) that matches your domain and enter it into /etc/hosts so local services and system emails resolve cleanly. Set up email forwarding for system messages so that you receive warnings from the server, for example about cron jobs or security updates. Define how long logs are kept, and plan storage space for backups and logs.
File systems, storage and partitions
On a fresh server, all data usually sits on one partition. For larger projects it can make sense to separate data: web files, database and backups on their own drives or volumes. That way a full backup directory cannot paralyze the system. Many providers offer additional volumes that can be enlarged later. Make sure there is enough space for the database and media files, and plan for growth. Monitor utilization, and set up warnings before a drive fills up. A common mistake is that log files or old backups silently fill the storage until the database can no longer write data.
An example: basic setup in numbers
- Server: 2 vCPU, 4 GB RAM, 80 GB SSD, location Germany
- Services: Nginx, PHP-FPM, MariaDB, Fail2ban, UFW
- Open ports: 80 and 443 for everyone, 22 only for your own IP
- Backups: Daily at 3 a.m., 14 days retention, stored externally, weekly server snapshot
- Updates: Security updates automatic, remaining updates monthly with testing
- Monitoring: Availability every two minutes, warning at more than 80 percent storage or load
With this basis, a medium-sized WordPress site runs stably. Adjust the values to your requirements and document every change.
Conclusion
Setting up your own Linux server delivers maximum performance, flexibility, and cost-efficiency—provided it rests on a solid foundation: a current LTS distribution, hardened SSH access, firewall rules, automatic updates, off-site backups, and monitoring. Working through these steps in order gives you a fast, secure base for WordPress, WooCommerce, and other web applications. If you want to save time, we are happy to take care of it. More on this on the page Set up server and VPS.

Frequently asked questions about setting up a Linux server
Which Linux distribution is best for WordPress?
Ubuntu Server LTS and Debian are the most common options. Both are stable, well documented and receive long security updates.
How much RAM does a WordPress server need?
For a medium-sized WordPress site, 2 to 4 GB of RAM (including database and PHP-FPM) is usually sufficient. WooCommerce stores or multi-site setups should start with at least 4 to 8 GB of RAM.
Is your own server more secure than web hosting?
Not automatically. It is only secure if you maintain it. Managed hosting takes this work off your hands and is the more secure choice for many.
What is the difference between a VPS and a dedicated server?
The difference between a VPS and a dedicated server lies in hardware sharing: a VPS is an isolated virtual slice of a physical server, whereas a dedicated server belongs entirely to you. For most WordPress sites and stores, a powerful VPS is plenty.
How do I secure SSH properly?
With SSH keys, disabled password login, disabled root login and Fail2ban. Always test changes in a second session.
Do I need a firewall if the provider has one?
Both together is best. The cloud firewall blocks in front of the server, the local firewall protects additionally inside the system.
How often do I have to update a server?
Security updates promptly, ideally automatically. Larger updates in a planned maintenance window with a backup.
Can I switch my server later?
Yes, a migration is possible. With good documentation and backups, this works without long downtime. We support you with our WordPress migration.
How long does setup take?
A basic setup can be done in one to two hours, a complete setup with web server, database, backups and monitoring takes longer.
What does a server cost?
Entry-level cloud VPS plans start at around $5 to $10 per month (e.g., with 2 vCPUs and 4 GB RAM). Pricing scales with performance, storage, and provider, while ongoing maintenance and security management are separate.