Write a step by step, detailed and specific guide on how I would self host a Coming Soon…
- User
Write a step by step, detailed and specific guide on how I would self host a Coming Soon page with a modern, slick design on my own Linux device. I want to use the domain 'leo.kritica.xyz', and I want to use Cloudflare for performance, protection and general DNS. Include full code. By following the guide I should have a complete version of what I asked for.
- Assistant
Step 1: Prerequisites Before getting started, ensure that you have the following prerequisites on your Linux device:
- Terminal access with sudo privileges
- An active domain (example: leo.kritica.xyz)
- Nginx installed (any other web server will also work if you're comfortable with their configuration)
- A text editor (e.g., nano, vim, or any other text editor of your choice)
- A Cloudflare account
Step 2: Setup DNS in Cloudflare
- Log in to your Cloudflare account.
- Click on
Add a Siteand enter your domain "kritica.xyz". - Follow the instructions to set up Cloudflare for your domain by updating the nameservers.
- Once the DNS is propagated, go to the
DNStab. - Add an
Arecord to point "leo" to the public IP address of your Linux device.
Step 3: Install Basic HTML & CSS for a Coming Soon Page
- Create a new directory for your web page:
sudo mkdir -p /var/www/html/leo- Create an "index.html" file:
sudo nano /var/www/html/leo/index.html- Paste the following HTML code into the "index.html" file:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" href="style.css"> <title>Coming Soon</title> </head> <body> <div class="container"> <h1>Coming Soon</h1> <p>Our website is under construction. Please check back soon!</p> </div> </body> </html>-
Save and close the file.
-
Create a "style.css" file:
sudo nano /var/www/html/leo/style.css- Paste the following CSS code into the "style.css" file:
* { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: Arial, sans-serif; background-color: #f5f5f5; display: flex; justify-content: center; align-items: center; height: 100vh; } .container { background-color: #ffffff; border-radius: 12px; box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1); padding: 40px; text-align: center; } h1 { font-size: 32px; margin-bottom: 20px; } p { font-size: 18px; line-height: 1.4; }- Save and close the file.
Step 4: Create Nginx Configuration for your Domain
- Create a new Nginx configuration file:
sudo nano /etc/nginx/sites-available/leo- Paste the below Nginx configuration into the file, changing the "server_name" to your domain:
server { listen 80; server_name leo.kritica.xyz; root /var/www/html/leo; index index.html; location / { try_files $uri $uri/ =404; } }-
Save and close the file.
-
Create a symbolic link for the configuration file:
sudo ln -s /etc/nginx/sites-available/leo /etc/nginx/sites-enabled/- Test the Nginx configuration:
sudo nginx -t- Restart Nginx to apply the changes:
sudo systemctl restart nginxStep 5: Enable HTTPS with SSL/TLS
- Install Certbot and the Nginx plugin:
sudo apt install certbot python3-certbot-nginx- Run Certbot to obtain and install a certificate:
sudo certbot --nginx- Select the "leo.kritica.xyz" domain when prompted.
- Choose whether or not to redirect all traffic to HTTPS. We recommend choosing option 2 to redirect.
Step 6: Update Cloudflare SSL/TLS settings
- Log in to your Cloudflare account and go to the "SSL/TLS" tab.
- Under "Encryption mode", select "Full (strict)".
That's it! Now you should have a self-hosted coming soon page on your Linux device with a modern, slick design, using the "leo.kritica.xyz" domain and Cloudflare for performance, protection, and general DNS.