Self-Hosting a Static Website: Planning and Decision-Making
This article covers the full thought process and decisions made when self-hosting a static website.
In the context of IT and the web, the term "static" refers to elements that don't change dynamically in response to user interactions or environmental changes. A static website, for example, is made up of fixed content delivered to the user exactly as it is stored.
At Reboot (our IT services company based in Strasbourg, France), for this project, we define "static" as all the frontend pages that need to be served by the server.
Self-hosting is the process of managing and maintaining a server and its services yourself, rather than relying on third-party hosted services. This practice gives you full control over server environments, data, and applications. In a self-hosting context, individuals or organizations deploy their own web applications, email servers, file storage systems, and other services on hardware or infrastructure they fully control.
Self-hosting can be done on physical servers located at a specific site or on Virtual Private Servers (VPS).
Self-hosting offers many advantages in terms of customization. We can choose our own security systems and technologies. Self-hosting therefore provides more control over your solution, but it also requires technical skills for system configuration and maintenance.
Currently, Reboot uses a variety of hosting providers to manage its online services, including Azure, OVH, and Hostinger. These providers offer different solutions to meet the needs of each of our applications. While each of these hosting solutions works, their costs range from 108 to 238 EUR per year, which is not negligible for a company like ours.
When selecting a self-hosting solution, several key criteria must be considered to ensure the system's effectiveness and long-term viability.
Cost is an essential factor when choosing a self-hosting solution. As we saw earlier, we have a variety of solutions with costs that pile up. The goal is to evaluate cost-effectiveness by considering not only the initial expenses for acquiring equipment and software, but also ongoing operational costs such as electricity, internet bandwidth, and maintenance fees. The most efficient approach would be to centralize our solutions to share costs.
Scalability is crucial for adapting to changing demands. A good self-hosting solution must be able to easily accommodate increases or decreases in required resources without needing a complete system overhaul. If tomorrow we want to host 500 websites, scaling our system must be quick and feasible.
Security is paramount for protecting data and services against unauthorized access, malicious attacks, and data loss. This includes implementing robust firewalls, intrusion detection systems, data quarantine measures, user rights management, and more.
Processing power, memory, storage, and bandwidth must be sufficient to handle the current and future workload. Performance must be monitored and optimized to ensure a smooth and fast user experience. If the Reboot-Conseil website takes 0.5 seconds to load, we risk losing visibility.
High availability is essential to ensure constant access to hosted services. Imagine we self-host our sites on a server at Reboot's Strasbourg office and a power outage occurs. All our sites must remain available and accessible. This may require redundant configurations, automatic failover solutions, and careful maintenance planning to minimize interruptions.
Finally, a good self-hosting solution requires fast, proactive maintenance and continuous monitoring. The key is knowing quickly if a site is no longer available so we can implement an appropriate Business Continuity Plan (BCP) or, in the worst case, a Disaster Recovery Plan (DRP) suited to our needs. Additionally, certificate management should be automated as much as possible to limit solution maintenance time. This helps detect and resolve problems quickly, keep the system up to date, and prevent potential failures.
A private cloud offers a dedicated cloud environment, providing superior control and customization, as well as enhanced security compared to public cloud solutions. However, this option comes with significantly higher costs in terms of infrastructure, maintenance, and management. For Reboot, the high initial investment and ongoing operational costs make the private cloud a less viable option compared to a VPS, which offers a more favorable balance between cost, control, and flexibility for our current needs.
Private Cloud
Kubernetes is an open-source container orchestration system that automates the deployment, scaling, and management of containerized applications. While it has become a market standard, Kubernetes requires a significant learning curve and often a dedicated expert for its management. For Reboot, although Kubernetes offers exceptional scalability and flexibility, the solution seems oversized for current needs, requiring resources and expertise that the company isn't (yet ;) ) ready to commit full-time.
Turnkey solutions, such as managed hosting platforms, offer simplicity of use with minimal maintenance and configuration required from the user. However, they are often limited in terms of technology choices and customization. For Reboot, these limitations make turnkey solutions less attractive, as they don't provide the flexibility needed to meet specific technology or configuration requirements.
Turnkey Solution
A Virtual Private Server (VPS) is a self-hosting solution that offers a balance between cost, control, and flexibility. A VPS functions as a virtual dedicated machine, giving users full control over their hosting environment with dedicated resource allocation. This solution is ideal for companies seeking extensive customization without the high costs associated with physical dedicated servers. The VPS was chosen by Reboot because of its ability to provide sufficient power and flexibility for most applications, without the prohibitive costs of private cloud solutions or the technical complexity of Kubernetes clusters.
VPS Solution
A web server is software and hardware that uses the HTTP (Hypertext Transfer Protocol) protocol and other protocols to respond to user requests on the Internet. On a web server, data and resources are stored, allowing users to access content simply by entering a domain name (reboot-conseil.com). Web servers process incoming requests, host websites and applications, and manage interactions with end users.
For the Reboot VPS, the web server runs on a virtual environment (VPS). We chose Nginx, a market standard that is compatible with Ubuntu.
NGINX web server
Fail2Ban is an intrusion prevention tool that protects servers against brute force attacks and other security threats. It monitors server logs to detect malicious behavior, such as repeated failed login attempts, and automatically blocks the attacker's IP address for a set period (putting it in "jail," so to speak). This reduces the risk of unauthorized access.
An SSL (Secure Sockets Layer) certificate is essential for securing communication between the web server and users' browsers. It "transforms" an HTTP site (port 80) into a secure HTTPS page (port 443). It encrypts the data being transferred, ensuring the confidentiality and integrity of the information.
Certbot is an agent used to automate obtaining and renewing SSL certificates via the ACME (Automated Certificate Management Environment) protocol. (For more information, see the dedicated post.)
Docker is a containerization platform that encapsulates an application and its dependencies in an isolated container. This allows us to run our application on any infrastructure, regardless of the versions and dependencies present.
Azure Ping Monitoring is a monitoring service that checks the availability and performance of web applications and services. It regularly sends requests (pings) to applications hosted on the Reboot VPS to ensure they are accessible and functioning correctly. If a problem occurs, it sends alerts, enabling a quick response to resolve issues.
The principle behind this solution is to set up a single VPS to host all our websites on one service. If we want to stay with an OVH Cloud solution (already in place for reboot-immobilier), we can estimate the cost of the solution at 12 EUR/excl. VAT/month. On top of that, there are the various domain names that need to be renewed each year.
This article is the 1st in a series of 14.
Membre de l'équipe Reboot à Strasbourg, Erin intervient sur les projets IT et conseil dans le Grand Est. Un profil qui préfère laisser parler ses résultats plutôt que son LinkedIn.
LinkedInGet our best articles every month.
Formateurs opérationnels. IA, data science, développement web. Certifié Qualiopi.
ProjectDébloquer la valeur cachée dans des milliers de documents. Un projet bancaire qui transforme la recherche documentaire en quelques secondes.
ProjectGarantir la qualité dans un environnement critique d'assurance. Un expert QA qui transforme les risques en certitudes.
ProjectVoir en temps réel ce qui se passe dans les entrailles de la production. Un projet de visibilité critique.
ProjectLe premier produit propre de Reboot Conseil. Une solution innovante née de la collaboration.
ProjectModerniser une DSI complète. Un tech lead pilotant la transformation d'une équipe.