<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Arthur</title>
    <description>The latest articles on DEV Community by Arthur (@arthur_luca).</description>
    <link>https://dev.to/arthur_luca</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4078497%2F225fdf23-256f-428a-a8c0-1b538e08c1ef.png</url>
      <title>DEV Community: Arthur</title>
      <link>https://dev.to/arthur_luca</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/arthur_luca"/>
    <language>en</language>
    <item>
      <title>How to Secure a Linux VPS: 10 Essential Security Practices</title>
      <dc:creator>Arthur</dc:creator>
      <pubDate>Fri, 27 Nov 2026 16:13:45 +0000</pubDate>
      <link>https://dev.to/arthur_luca/how-to-secure-a-linux-vps-10-essential-security-practices-6pb</link>
      <guid>https://dev.to/arthur_luca/how-to-secure-a-linux-vps-10-essential-security-practices-6pb</guid>
      <description>&lt;p&gt;Hello, I'm Arthur. Setting up a Linux VPS is only the beginning of managing a server. Keeping it secure is equally important.&lt;/p&gt;

&lt;p&gt;A VPS connected to the internet can receive login attempts, automated scans, and attacks targeting outdated software or weak configurations.&lt;/p&gt;

&lt;p&gt;Whether you're hosting a website, running an application, or managing a database, basic security practices can help reduce unnecessary risks.&lt;/p&gt;

&lt;p&gt;In this guide, we'll explore 10 practical ways to improve Linux VPS security.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Keep Your Operating System Updated
&lt;/h2&gt;

&lt;p&gt;One of the simplest security practices is installing system updates regularly.&lt;/p&gt;

&lt;p&gt;Updates often include security patches, bug fixes, and improvements.&lt;/p&gt;

&lt;p&gt;On Ubuntu or Debian, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo apt update
sudo apt upgrade
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Review available updates and install them regularly to reduce exposure to known vulnerabilities.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Use Strong Passwords
&lt;/h2&gt;

&lt;p&gt;Weak passwords make unauthorized access easier.&lt;/p&gt;

&lt;p&gt;If your server allows password authentication, use a long, unique password that is not shared with other accounts.&lt;/p&gt;

&lt;p&gt;Avoid:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Common passwords&lt;/li&gt;
&lt;li&gt;Personal information&lt;/li&gt;
&lt;li&gt;Repeated passwords&lt;/li&gt;
&lt;li&gt;Easily predictable combinations&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A password manager can help generate and store strong passwords.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Enable SSH Key Authentication
&lt;/h2&gt;

&lt;p&gt;SSH keys provide a secure alternative to password-based server login.&lt;/p&gt;

&lt;p&gt;Generate a key pair on your local machine:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh-keygen -t ed25519
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Copy the public key to your server:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh-copy-id username@your_server_ip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After confirming that key-based login works, you can consider disabling SSH password authentication.&lt;/p&gt;

&lt;p&gt;Always keep an alternative recovery method before changing SSH settings.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Change Default SSH Settings Carefully
&lt;/h2&gt;

&lt;p&gt;SSH is commonly used for remote Linux administration.&lt;/p&gt;

&lt;p&gt;You can review its configuration file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo nano /etc/ssh/sshd_config
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Administrators often consider:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Disabling root login&lt;/li&gt;
&lt;li&gt;Using SSH keys&lt;/li&gt;
&lt;li&gt;Restricting access to trusted users&lt;/li&gt;
&lt;li&gt;Reviewing allowed authentication methods&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After making changes, validate the configuration and reload the SSH service.&lt;/p&gt;

&lt;p&gt;Keep your existing SSH session open until you have confirmed that a new login works.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Configure a Firewall
&lt;/h2&gt;

&lt;p&gt;A firewall controls which network connections are allowed to reach your server.&lt;/p&gt;

&lt;p&gt;On Ubuntu, UFW provides a simple way to manage firewall rules.&lt;/p&gt;

&lt;p&gt;Check its status:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo ufw status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Allow SSH:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo ufw allow OpenSSH
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Allow web traffic:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Enable the firewall:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo ufw &lt;span class="nb"&gt;enable&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Only open ports that your applications actually need. Make sure SSH access is allowed before enabling firewall rules to avoid locking yourself out.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Disable Unnecessary Services
&lt;/h2&gt;

&lt;p&gt;Every unnecessary running service can increase your server's attack surface.&lt;/p&gt;

&lt;p&gt;List active services:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;systemctl list-units --type=service --state=running
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Review the services and identify anything that is not required.&lt;/p&gt;

&lt;p&gt;Before disabling a service, understand what it does and confirm that no application depends on it.&lt;/p&gt;

&lt;p&gt;Reducing unnecessary services can improve both security and resource management.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Install Fail2ban
&lt;/h2&gt;

&lt;p&gt;Repeated login attempts can be a warning sign of automated attacks.&lt;/p&gt;

&lt;p&gt;Fail2ban monitors logs and can temporarily block IP addresses that repeatedly trigger suspicious authentication failures.&lt;/p&gt;

&lt;p&gt;On Ubuntu, install it with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo apt install fail2ban
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check its service status:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo systemctl status fail2ban
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Configure its rules according to your SSH and application requirements.&lt;/p&gt;

&lt;p&gt;Fail2ban is useful, but it should not replace strong authentication and firewall protection.&lt;/p&gt;

&lt;h2&gt;
  
  
  8. Monitor Server Logs
&lt;/h2&gt;

&lt;p&gt;Server logs provide valuable information about system activity.&lt;/p&gt;

&lt;p&gt;For example, view recent SSH-related authentication messages with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo journalctl -u ssh -n 50
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On some distributions, authentication events are also recorded in:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo tail -f /var/log/auth.log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Look for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Repeated failed login attempts&lt;/li&gt;
&lt;li&gt;Unexpected service activity&lt;/li&gt;
&lt;li&gt;Unusual authentication times&lt;/li&gt;
&lt;li&gt;Unknown login sessions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Regular log reviews can help identify suspicious behavior early.&lt;/p&gt;

&lt;h2&gt;
  
  
  9. Create Regular Backups
&lt;/h2&gt;

&lt;p&gt;Security is not only about preventing unauthorized access. It's also about recovering from unexpected incidents.&lt;/p&gt;

&lt;p&gt;A backup can help restore important files after accidental deletion, hardware failure, or a security incident.&lt;/p&gt;

&lt;p&gt;A good backup strategy includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Regular automated backups&lt;/li&gt;
&lt;li&gt;Copies stored outside the VPS&lt;/li&gt;
&lt;li&gt;Restricted backup access&lt;/li&gt;
&lt;li&gt;Periodic restoration tests&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Never assume a backup works until you have successfully tested the recovery process.&lt;/p&gt;

&lt;h2&gt;
  
  
  10. Use HTTPS for Websites
&lt;/h2&gt;

&lt;p&gt;If your VPS hosts a website, HTTPS helps protect data transferred between visitors and your server.&lt;/p&gt;

&lt;p&gt;You can obtain an SSL/TLS certificate using Let's Encrypt.&lt;/p&gt;

&lt;p&gt;For an Nginx website on Ubuntu, Certbot can help configure HTTPS.&lt;/p&gt;

&lt;p&gt;Remember to renew certificates before they expire and verify that HTTP traffic redirects to HTTPS where appropriate.&lt;/p&gt;

&lt;h2&gt;
  
  
  Choosing the Right VPS for Secure Server Management
&lt;/h2&gt;

&lt;p&gt;Security also depends on the server environment and how it is managed.&lt;/p&gt;

&lt;p&gt;When selecting a VPS, consider:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Reliable infrastructure&lt;/li&gt;
&lt;li&gt;Operating system support&lt;/li&gt;
&lt;li&gt;Backup options&lt;/li&gt;
&lt;li&gt;Network security features&lt;/li&gt;
&lt;li&gt;Available technical support&lt;/li&gt;
&lt;li&gt;Sufficient CPU, RAM, and storage&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you're looking for a Linux environment to host websites, applications, or development projects, you can explore &lt;a href="https://helloserver.tech/vps-hosting/" rel="noopener noreferrer"&gt;HelloServer VPS Hosting&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For workloads that require specialized computing resources, including AI development and machine learning, &lt;a href="https://helloserver.tech/gpu-dedicated-server/" rel="noopener noreferrer"&gt;HelloServer GPU Dedicated Servers&lt;/a&gt; are another option to consider.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Securing a Linux VPS is an ongoing responsibility, not a one-time task.&lt;/p&gt;

&lt;p&gt;Keeping software updated, using SSH keys, configuring a firewall, monitoring logs, and maintaining reliable backups are important steps toward better server security.&lt;/p&gt;

&lt;p&gt;Start with these basic practices and review your server configuration regularly.&lt;/p&gt;

&lt;p&gt;A well-maintained server is easier to manage, more resilient, and better prepared to handle everyday security risks.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>cybersecurity</category>
      <category>servermanagement</category>
      <category>vps</category>
    </item>
    <item>
      <title>10 Linux Commands Every Beginner Should Know for Server Management</title>
      <dc:creator>Arthur</dc:creator>
      <pubDate>Fri, 27 Nov 2026 16:05:18 +0000</pubDate>
      <link>https://dev.to/arthur_luca/10-linux-commands-every-beginner-should-know-for-server-management-oba</link>
      <guid>https://dev.to/arthur_luca/10-linux-commands-every-beginner-should-know-for-server-management-oba</guid>
      <description>&lt;p&gt;Hello, I'm Arthur. Linux is one of the most widely used operating systems for managing web servers, cloud infrastructure, and development environments.&lt;/p&gt;

&lt;p&gt;If you're planning to work with VPS hosting or manage your own server, learning basic Linux commands is an important first step.&lt;/p&gt;

&lt;p&gt;You don't need to be an expert to get started. Understanding a few essential commands can help you navigate files, monitor resources, manage processes, and troubleshoot common server problems.&lt;/p&gt;

&lt;p&gt;Let's explore 10 useful Linux commands with practical examples.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Check Your Current Directory
&lt;/h2&gt;

&lt;p&gt;When working through a Linux terminal, it's important to know where you are.&lt;/p&gt;

&lt;p&gt;Use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;pwd&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command displays your current working directory.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;/home/ubuntu
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It helps you avoid creating or editing files in the wrong location.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. List Files and Directories
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;ls&lt;/code&gt; command displays files and folders in your current directory.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ls
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For additional information, use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ls -lah
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This displays hidden files, file permissions, ownership, and file sizes in a readable format.&lt;/p&gt;

&lt;p&gt;It's particularly useful when managing server directories.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Navigate Between Directories
&lt;/h2&gt;

&lt;p&gt;Use &lt;code&gt;cd&lt;/code&gt; to move between directories.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; /var/www
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To return to your home directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; ~
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To move one directory backward:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; ..
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These commands make it easier to navigate Linux file systems.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Create Files and Directories
&lt;/h2&gt;

&lt;p&gt;Linux provides simple commands for creating files and directories.&lt;/p&gt;

&lt;p&gt;Create a directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mkdir my-project
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create an empty file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;touch index.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also create multiple directories using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mkdir -p project/logs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;-p&lt;/code&gt; option creates parent directories when necessary.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Check Disk Space
&lt;/h2&gt;

&lt;p&gt;Running out of disk space can affect websites, databases, and applications.&lt;/p&gt;

&lt;p&gt;Use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;df -h
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This displays disk usage in a human-readable format.&lt;/p&gt;

&lt;p&gt;To identify which directory is consuming space:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;du -sh /var/log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Regular disk monitoring helps prevent unexpected storage problems.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Monitor CPU and Memory Usage
&lt;/h2&gt;

&lt;p&gt;Server performance depends on available resources.&lt;/p&gt;

&lt;p&gt;Use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;top
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This displays running processes, CPU usage, memory consumption, and system activity.&lt;/p&gt;

&lt;p&gt;For a more detailed interactive interface, you can install and use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;htop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These tools help identify processes that may be slowing down your server.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Check Running Processes
&lt;/h2&gt;

&lt;p&gt;Sometimes, an application continues running in the background even after you close its terminal session.&lt;/p&gt;

&lt;p&gt;To list running processes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ps aux
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To search for a particular process:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ps aux &lt;span class="o"&gt;|&lt;/span&gt; grep nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is useful when troubleshooting services and applications.&lt;/p&gt;

&lt;h2&gt;
  
  
  8. Check Network Connectivity
&lt;/h2&gt;

&lt;p&gt;Network problems can cause websites and applications to become inaccessible.&lt;/p&gt;

&lt;p&gt;Use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ping google.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This checks whether your server can communicate with another network destination.&lt;/p&gt;

&lt;p&gt;You can also check your network configuration using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ip addr
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These commands are helpful when investigating connectivity issues.&lt;/p&gt;

&lt;h2&gt;
  
  
  9. Manage Linux Services
&lt;/h2&gt;

&lt;p&gt;Linux servers often run services such as Nginx, Apache, and MySQL.&lt;/p&gt;

&lt;p&gt;You can check a service's status with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo systemctl status nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To restart Nginx:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo systemctl restart nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To start a stopped service:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo systemctl start nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Always check the service status after making changes.&lt;/p&gt;

&lt;h2&gt;
  
  
  10. View Server Logs
&lt;/h2&gt;

&lt;p&gt;Logs help administrators understand what happened when an application or service experienced an error.&lt;/p&gt;

&lt;p&gt;For example, to view recent system logs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;journalctl -n 50
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To follow Nginx error logs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo tail -f /var/log/nginx/error.log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Reading logs is one of the most useful troubleshooting skills for Linux administrators.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where Can You Practice Linux Commands?
&lt;/h2&gt;

&lt;p&gt;The best way to learn Linux is through practical experience.&lt;/p&gt;

&lt;p&gt;You can start with a local virtual machine or a Linux VPS. Having your own Linux environment allows you to practice file management, install applications, configure services, and monitor system resources.&lt;/p&gt;

&lt;p&gt;If you want a remote Linux environment for development and server administration, &lt;a href="https://helloserver.tech/vps-hosting/" rel="noopener noreferrer"&gt;HelloServer VPS Hosting&lt;/a&gt; is worth exploring.&lt;/p&gt;

&lt;p&gt;For more demanding computing tasks, such as AI development, deep learning, and GPU-based workloads, you can also explore &lt;a href="https://helloserver.tech/gpu-dedicated-server/" rel="noopener noreferrer"&gt;HelloServer GPU Dedicated Servers&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Learning Linux commands doesn't happen overnight, but consistent practice makes server management much easier.&lt;/p&gt;

&lt;p&gt;Start with basic navigation and file management, then move toward monitoring resources, managing services, and troubleshooting logs.&lt;/p&gt;

&lt;p&gt;These 10 commands provide a useful foundation for anyone interested in Linux administration, VPS management, or DevOps.&lt;/p&gt;

&lt;p&gt;The more you practice, the more comfortable you'll become working directly from the terminal.&lt;/p&gt;

</description>
      <category>server</category>
      <category>linux</category>
      <category>beginners</category>
      <category>devops</category>
    </item>
    <item>
      <title>Why Does Your VPS Become Slow? 8 Common Problems and How to Fix Them</title>
      <dc:creator>Arthur</dc:creator>
      <pubDate>Fri, 27 Nov 2026 15:56:16 +0000</pubDate>
      <link>https://dev.to/arthur_luca/why-does-your-vps-become-slow-8-common-problems-and-how-to-fix-them-43fe</link>
      <guid>https://dev.to/arthur_luca/why-does-your-vps-become-slow-8-common-problems-and-how-to-fix-them-43fe</guid>
      <description>&lt;p&gt;Hello, I'm Arthur. Have you ever experienced a situation where your website or application suddenly becomes slow, even though everything was working fine before?&lt;/p&gt;

&lt;p&gt;A slow VPS can affect website performance, application response times, and the overall user experience.&lt;/p&gt;

&lt;p&gt;The problem is not always your hosting provider. Sometimes, the cause is high resource usage, incorrect configurations, background processes, or an overloaded database.&lt;/p&gt;

&lt;p&gt;In this article, we'll explore eight common reasons why a VPS becomes slow and how you can troubleshoot them.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. High CPU Usage
&lt;/h2&gt;

&lt;p&gt;CPU usage is one of the first things you should check when your VPS becomes slow.&lt;/p&gt;

&lt;p&gt;Applications, background scripts, database queries, and multiple running processes can consume significant CPU resources.&lt;/p&gt;

&lt;p&gt;On Linux, use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;top
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;htop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These commands help identify which processes are consuming the most CPU resources.&lt;/p&gt;

&lt;p&gt;If one process consistently uses too much CPU, investigate it before restarting services.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Not Enough RAM
&lt;/h2&gt;

&lt;p&gt;Memory problems can make even a simple website feel extremely slow.&lt;/p&gt;

&lt;p&gt;When available RAM becomes limited, Linux may use swap space to handle additional memory requirements.&lt;/p&gt;

&lt;p&gt;Check memory usage with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;free -h
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To check swap usage:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;swapon --show
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If your VPS regularly runs out of memory, consider optimizing your applications or increasing available RAM.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Too Many Background Processes
&lt;/h2&gt;

&lt;p&gt;Some applications continue running background tasks even when users are not actively accessing them.&lt;/p&gt;

&lt;p&gt;Examples include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Scheduled backup jobs&lt;/li&gt;
&lt;li&gt;Database maintenance&lt;/li&gt;
&lt;li&gt;Cron jobs&lt;/li&gt;
&lt;li&gt;Application workers&lt;/li&gt;
&lt;li&gt;Monitoring services&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Check running processes using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ps aux
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Review unnecessary services and disable only those you understand and no longer need.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Slow Disk Performance
&lt;/h2&gt;

&lt;p&gt;Disk performance is another important factor.&lt;/p&gt;

&lt;p&gt;A server may have sufficient CPU and RAM but still experience slow response times because of heavy disk activity.&lt;/p&gt;

&lt;p&gt;Check disk space:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;df -h
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check disk usage by directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;du -sh /var/log/*
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For more detailed disk performance monitoring, you can use tools such as &lt;code&gt;iostat&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Keep enough free disk space and avoid unnecessary file storage.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Database Queries Taking Too Long
&lt;/h2&gt;

&lt;p&gt;Web applications often depend on databases to retrieve information.&lt;/p&gt;

&lt;p&gt;Poorly optimized queries, missing indexes, and large database tables can increase response times.&lt;/p&gt;

&lt;p&gt;Some practical improvements include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Add appropriate database indexes.&lt;/li&gt;
&lt;li&gt;Avoid unnecessary database queries.&lt;/li&gt;
&lt;li&gt;Use caching where suitable.&lt;/li&gt;
&lt;li&gt;Review slow query logs.&lt;/li&gt;
&lt;li&gt;Remove unnecessary database operations.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Database optimization can make a noticeable difference, especially on websites with frequent user requests.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Incorrect Server Configuration
&lt;/h2&gt;

&lt;p&gt;Sometimes, server performance problems come from configuration settings.&lt;/p&gt;

&lt;p&gt;For example, an application may have too many worker processes or insufficient connection limits.&lt;/p&gt;

&lt;p&gt;Review your web server configuration and application settings.&lt;/p&gt;

&lt;p&gt;For Nginx, you can test the configuration with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo nginx -t
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For Apache, use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo apachectl configtest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Always create a backup before changing important configuration files.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Network Problems
&lt;/h2&gt;

&lt;p&gt;A slow website is not always caused by CPU, RAM, or storage.&lt;/p&gt;

&lt;p&gt;Network latency, packet loss, and bandwidth limitations can also affect performance.&lt;/p&gt;

&lt;p&gt;You can test network connectivity using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ping google.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For checking network routes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;traceroute google.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you notice unusual latency, investigate the network path and server connectivity.&lt;/p&gt;

&lt;h2&gt;
  
  
  8. Choosing the Wrong Server Resources
&lt;/h2&gt;

&lt;p&gt;Different applications require different server resources.&lt;/p&gt;

&lt;p&gt;A small business website may work comfortably on a basic VPS, while a database-heavy application or multiple Docker containers may need more RAM and CPU power.&lt;/p&gt;

&lt;p&gt;Before selecting a server, consider:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Expected website traffic&lt;/li&gt;
&lt;li&gt;Number of running applications&lt;/li&gt;
&lt;li&gt;Memory requirements&lt;/li&gt;
&lt;li&gt;Storage performance&lt;/li&gt;
&lt;li&gt;Network bandwidth&lt;/li&gt;
&lt;li&gt;Future growth&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you need a Linux environment for websites, development, or application deployment, you can explore &lt;a href="https://helloserver.tech/vps-hosting/" rel="noopener noreferrer"&gt;HelloServer VPS Hosting&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For demanding workloads such as AI development, machine learning, and GPU-intensive applications, dedicated hardware may be a better option. You can also explore &lt;a href="https://helloserver.tech/gpu-dedicated-server/" rel="noopener noreferrer"&gt;HelloServer GPU Dedicated Servers&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;A slow VPS does not always mean you need a bigger server.&lt;/p&gt;

&lt;p&gt;Before upgrading, identify the actual problem. Monitor CPU and RAM usage, review disk performance, optimize database queries, and check your network connection.&lt;/p&gt;

&lt;p&gt;Small improvements in server configuration and application management can sometimes solve major performance problems.&lt;/p&gt;

&lt;p&gt;The best approach is to monitor your server regularly and choose resources based on your actual workload rather than guessing.&lt;/p&gt;

</description>
      <category>servermanagement</category>
      <category>webdev</category>
      <category>linux</category>
      <category>vps</category>
    </item>
    <item>
      <title>Docker for Beginners: Containerize a Python Application Step by Step</title>
      <dc:creator>Arthur</dc:creator>
      <pubDate>Fri, 27 Nov 2026 15:48:31 +0000</pubDate>
      <link>https://dev.to/arthur_luca/docker-for-beginners-containerize-a-python-application-step-by-step-54h3</link>
      <guid>https://dev.to/arthur_luca/docker-for-beginners-containerize-a-python-application-step-by-step-54h3</guid>
      <description>&lt;p&gt;Hello, I'm Arthur. Have you ever worked on a Python application that runs perfectly on your computer but fails when you try to run it on another machine?&lt;/p&gt;

&lt;p&gt;Maybe the Python version is different, a required package is missing, or the application depends on a system library that is not installed.&lt;/p&gt;

&lt;p&gt;Docker helps solve this problem by packaging an application and its dependencies into a container.&lt;/p&gt;

&lt;p&gt;In this tutorial, we'll build a simple Python application, create a Docker image, and run it inside a container.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Understand the Difference Between an Image and a Container
&lt;/h2&gt;

&lt;p&gt;Before writing any commands, it helps to understand two important Docker concepts.&lt;/p&gt;

&lt;p&gt;A Docker image is a packaged template containing the application, its dependencies, and the instructions needed to run it.&lt;/p&gt;

&lt;p&gt;A container is a running instance of that image.&lt;/p&gt;

&lt;p&gt;You can create multiple containers from the same image without rebuilding the application each time.&lt;/p&gt;

&lt;p&gt;For example, you might use one image to run a development environment and another container to run a separate test instance.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Install Docker
&lt;/h2&gt;

&lt;p&gt;Docker is available for Linux, Windows, and macOS.&lt;/p&gt;

&lt;p&gt;For this tutorial, we'll use Docker on Linux.&lt;/p&gt;

&lt;p&gt;On Ubuntu, follow the official Docker installation instructions to install Docker Engine and the Docker CLI.&lt;/p&gt;

&lt;p&gt;After installation, check the version:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker --version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verify that Docker is running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo systemctl status docker
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also run a test container:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo docker run hello-world
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If Docker is installed correctly, the command downloads a small image and runs a container that prints a confirmation message.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Create a Python Application
&lt;/h2&gt;

&lt;p&gt;Create a project directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mkdir docker-python-app
&lt;span class="nb"&gt;cd&lt;/span&gt; docker-python-app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create a file named &lt;code&gt;app.py&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;

&lt;span class="n"&gt;app_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getenv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"APP_NAME"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"My Python App"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"Welcome to {app_name}!"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This application reads a value from an environment variable.&lt;/p&gt;

&lt;p&gt;If the variable is not set, it uses the default name.&lt;/p&gt;

&lt;p&gt;Test it locally:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 app.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expected output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Welcome to My Python App!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now let's package this application using Docker.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Write Your First Dockerfile
&lt;/h2&gt;

&lt;p&gt;Create a file named &lt;code&gt;Dockerfile&lt;/code&gt; in the project directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;&lt;span class="k"&gt;FROM&lt;/span&gt; python:3.12-slim

&lt;span class="k"&gt;WORKDIR&lt;/span&gt; /app

&lt;span class="k"&gt;COPY&lt;/span&gt; app.py .

&lt;span class="k"&gt;CMD&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"python"&lt;/span&gt;, &lt;span class="s2"&gt;"app.py"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's understand what each instruction does.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;FROM&lt;/code&gt; selects the base image containing Python.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;WORKDIR&lt;/code&gt; sets the working directory inside the container.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;COPY&lt;/code&gt; copies the application file into the image.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;CMD&lt;/code&gt; defines the command that runs when the container starts.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The &lt;code&gt;python:3.12-slim&lt;/code&gt; image is a smaller Python image based on Debian.&lt;/p&gt;

&lt;p&gt;For a real project, choose a Python version that is compatible with your application's dependencies.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Build a Docker Image
&lt;/h2&gt;

&lt;p&gt;Run this command from the project directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker build -t my-python-app .
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;-t&lt;/code&gt; option gives the image a name.&lt;/p&gt;

&lt;p&gt;The final dot tells Docker to use the current directory as the build context.&lt;/p&gt;

&lt;p&gt;Docker reads the Dockerfile, downloads the required base image if necessary, and creates the application image.&lt;/p&gt;

&lt;p&gt;Check that the image exists:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker images
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see &lt;code&gt;my-python-app&lt;/code&gt; in the list.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Run Your Application Inside a Container
&lt;/h2&gt;

&lt;p&gt;Start the container:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker run my-python-app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Welcome to My Python App!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The application is now running inside a Docker container rather than directly in your local Python environment.&lt;/p&gt;

&lt;p&gt;You can also override the environment variable:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker run -e &lt;span class="nv"&gt;APP_NAME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"Docker Demo"&lt;/span&gt; my-python-app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The output will be:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Welcome to Docker Demo!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is useful when the same application needs different configuration values in development, testing, and production.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Make the Container Run in the Background
&lt;/h2&gt;

&lt;p&gt;Some applications need to keep running instead of finishing immediately.&lt;/p&gt;

&lt;p&gt;Docker can run a container in detached mode using the &lt;code&gt;-d&lt;/code&gt; option.&lt;/p&gt;

&lt;p&gt;For example, you could use a long-running Python application or a web server.&lt;/p&gt;

&lt;p&gt;To see the containers that are currently running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker ps
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To view stopped containers as well:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker ps -a
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can stop a running container with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker stop CONTAINER_ID
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace &lt;code&gt;CONTAINER_ID&lt;/code&gt; with the actual ID shown by Docker.&lt;/p&gt;

&lt;p&gt;To remove a stopped container:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker rm CONTAINER_ID
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These commands help you manage containers during development and testing.&lt;/p&gt;

&lt;h2&gt;
  
  
  8. Use a .dockerignore File
&lt;/h2&gt;

&lt;p&gt;When building an image, Docker sends files from the build context to the build process.&lt;/p&gt;

&lt;p&gt;You generally don't need to include local virtual environments, Git history, or temporary files.&lt;/p&gt;

&lt;p&gt;Create a &lt;code&gt;.dockerignore&lt;/code&gt; file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;venv/
__pycache__/
.git/
*.pyc
.env
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This prevents those files from being included in the build context.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;.env&lt;/code&gt; entry is particularly important if your project contains local configuration files with sensitive values.&lt;/p&gt;

&lt;p&gt;However, &lt;code&gt;.dockerignore&lt;/code&gt; is not a complete secret-management solution. Never copy passwords, API keys, or private credentials into a Docker image.&lt;/p&gt;

&lt;h2&gt;
  
  
  9. Understand Docker Image Layers
&lt;/h2&gt;

&lt;p&gt;Docker builds images in layers.&lt;/p&gt;

&lt;p&gt;Each instruction in a Dockerfile can create a layer that Docker may reuse during later builds.&lt;/p&gt;

&lt;p&gt;This is useful because unchanged layers can be cached.&lt;/p&gt;

&lt;p&gt;For example, if your application has a &lt;code&gt;requirements.txt&lt;/code&gt; file, you can copy it and install dependencies before copying the rest of your source code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;&lt;span class="k"&gt;FROM&lt;/span&gt; python:3.12-slim

&lt;span class="k"&gt;WORKDIR&lt;/span&gt; /app

&lt;span class="k"&gt;COPY&lt;/span&gt; requirements.txt .

&lt;span class="k"&gt;RUN&lt;/span&gt; pip install --no-cache-dir -r requirements.txt

&lt;span class="k"&gt;COPY&lt;/span&gt; . .

&lt;span class="k"&gt;CMD&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"python"&lt;/span&gt;, &lt;span class="s2"&gt;"app.py"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When your application code changes but the dependency file stays the same, Docker can often reuse the dependency installation layer.&lt;/p&gt;

&lt;p&gt;This can make repeated builds faster.&lt;/p&gt;

&lt;h2&gt;
  
  
  10. Run Your Container on a VPS
&lt;/h2&gt;

&lt;p&gt;Docker can be useful when you want to run the same application in different environments.&lt;/p&gt;

&lt;p&gt;For example, you might build an image on your development machine and then run it on a Linux VPS.&lt;/p&gt;

&lt;p&gt;Before deploying, make sure:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Docker is installed and configured correctly.&lt;/li&gt;
&lt;li&gt;The server has enough CPU, RAM, and disk space.&lt;/li&gt;
&lt;li&gt;Required ports are configured correctly.&lt;/li&gt;
&lt;li&gt;Sensitive configuration values are stored securely.&lt;/li&gt;
&lt;li&gt;Container logs and restart behavior are managed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you're comparing server options for containerized applications, &lt;a href="https://helloserver.tech/vps-hosting/" rel="noopener noreferrer"&gt;HelloServer VPS hosting&lt;/a&gt; is one option to explore.&lt;/p&gt;

&lt;p&gt;A VPS can provide a separate Linux environment for running your containers and managing your application.&lt;/p&gt;

&lt;h2&gt;
  
  
  11. Build and Run the Same Image on Another Machine
&lt;/h2&gt;

&lt;p&gt;One of Docker's main benefits is that you can share an image instead of manually recreating the entire application environment.&lt;/p&gt;

&lt;p&gt;For example, you can tag your image:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker tag my-python-app username/my-python-app:1.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then push it to a container registry after authenticating:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker push username/my-python-app:1.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On another machine, you can pull the image:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker pull username/my-python-app:1.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And run it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker run username/my-python-app:1.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This workflow is useful for teams that want a consistent application environment across development and deployment.&lt;/p&gt;

&lt;p&gt;For larger workloads that require specialized hardware, you can also compare &lt;a href="https://helloserver.tech/gpu-dedicated-server/" rel="noopener noreferrer"&gt;HelloServer GPU dedicated servers&lt;/a&gt; when planning your infrastructure.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Docker is a practical tool for packaging applications and making their environments more consistent.&lt;/p&gt;

&lt;p&gt;You have learned how to create a Dockerfile, build an image, run a container, and configure an application using environment variables.&lt;/p&gt;

&lt;p&gt;The next step is to learn how to manage persistent data, connect containers to networks, and use Docker Compose for applications with multiple services.&lt;/p&gt;

&lt;p&gt;Start with a small Python project and practice building and running it in a container.&lt;/p&gt;

&lt;p&gt;Once you understand the basics, you'll be better prepared to use Docker in larger development and deployment workflows.&lt;/p&gt;

</description>
      <category>docker</category>
      <category>beginners</category>
      <category>python</category>
      <category>performance</category>
    </item>
    <item>
      <title>Python Logging Tutorial: How to Track Errors and Debug Applications</title>
      <dc:creator>Arthur</dc:creator>
      <pubDate>Fri, 27 Nov 2026 15:41:40 +0000</pubDate>
      <link>https://dev.to/arthur_luca/python-logging-tutorial-how-to-track-errors-and-debug-applications-176e</link>
      <guid>https://dev.to/arthur_luca/python-logging-tutorial-how-to-track-errors-and-debug-applications-176e</guid>
      <description>&lt;p&gt;Hello, I'm Arthur. Have you ever written a Python script that worked perfectly yesterday but suddenly failed today?&lt;/p&gt;

&lt;p&gt;Maybe it stopped processing files, returned an unexpected result, or crashed without explaining what went wrong.&lt;/p&gt;

&lt;p&gt;When you're working with larger applications, using &lt;code&gt;print()&lt;/code&gt; statements everywhere can make debugging difficult.&lt;/p&gt;

&lt;p&gt;Python's built-in &lt;code&gt;logging&lt;/code&gt; module provides a better way to record application activity, track errors, and understand what happened when something failed.&lt;/p&gt;

&lt;p&gt;In this tutorial, we'll build a practical logging system that you can use in your own Python projects.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Understand Why Logging Matters
&lt;/h2&gt;

&lt;p&gt;Logging allows your application to record important events while it runs.&lt;/p&gt;

&lt;p&gt;For example, you might want to know:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;When an application starts or stops&lt;/li&gt;
&lt;li&gt;Which files were processed&lt;/li&gt;
&lt;li&gt;Whether an API request failed&lt;/li&gt;
&lt;li&gt;Why a database connection could not be established&lt;/li&gt;
&lt;li&gt;When an unexpected error occurred&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Instead of displaying every message on the screen, you can save important information in a log file and review it later.&lt;/p&gt;

&lt;p&gt;Python already includes a logging module, so you do not need to install an additional package.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Create Your First Log Messages
&lt;/h2&gt;

&lt;p&gt;Create a Python file named &lt;code&gt;app.py&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;logging&lt;/span&gt;

&lt;span class="n"&gt;logging&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;basicConfig&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;level&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;logging&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;INFO&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;logging&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;debug&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"This is a debugging message"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;logging&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;info&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Application started"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;logging&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;warning&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Disk space is getting low"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;logging&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Unable to process the request"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run the script:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 app.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You will see the informational, warning, and error messages.&lt;/p&gt;

&lt;p&gt;The debug message will not appear because the logging level is set to &lt;code&gt;INFO&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Python supports five standard logging levels:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Level&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;DEBUG&lt;/td&gt;
&lt;td&gt;Detailed information for troubleshooting&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;INFO&lt;/td&gt;
&lt;td&gt;Confirmation that something worked&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;WARNING&lt;/td&gt;
&lt;td&gt;An unexpected situation that may need attention&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ERROR&lt;/td&gt;
&lt;td&gt;A problem that prevented an operation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CRITICAL&lt;/td&gt;
&lt;td&gt;A serious failure that may stop the application&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Choosing the correct level helps you understand which events require attention.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Save Logs to a File
&lt;/h2&gt;

&lt;p&gt;For applications running on a server, saving logs to a file is often more useful than displaying them in a terminal.&lt;/p&gt;

&lt;p&gt;Update your logging configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;logging&lt;/span&gt;

&lt;span class="n"&gt;logging&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;basicConfig&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;filename&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"app.log"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;level&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;logging&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;INFO&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nb"&gt;format&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"%(asctime)s - %(levelname)s - %(message)s"&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;logging&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;info&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Application started"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;logging&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;warning&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"A configuration value is missing"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run the script again.&lt;/p&gt;

&lt;p&gt;A file named &lt;code&gt;app.log&lt;/code&gt; will be created in the current working directory.&lt;/p&gt;

&lt;p&gt;The log entries will include a timestamp, the logging level, and the message.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;2026-11-27 10:30:00,000 - INFO - Application started
2026-11-27 10:30:01,000 - WARNING - A configuration value is missing
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Timestamps are particularly useful when investigating problems that occur only at certain times.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Record Python Exceptions Properly
&lt;/h2&gt;

&lt;p&gt;One of the most useful logging features is the ability to record exception details.&lt;/p&gt;

&lt;p&gt;Consider a script that reads a configuration file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;logging&lt;/span&gt;

&lt;span class="n"&gt;logging&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;basicConfig&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;filename&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"app.log"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;level&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;logging&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;INFO&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="nb"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"config.json"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;read&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="nc"&gt;FileNotFoundError&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;logging&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;exception&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Configuration file could not be found"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the file does not exist, the application will record the error and its traceback.&lt;/p&gt;

&lt;p&gt;The traceback helps you identify where the exception occurred.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;logging.exception()&lt;/code&gt; method should be used inside an exception handler.&lt;/p&gt;

&lt;p&gt;This is more useful than writing only the error message because the traceback provides additional debugging information.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Use Logging in a Real Python Function
&lt;/h2&gt;

&lt;p&gt;Let's create a simple function that processes a list of user records.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;logging&lt;/span&gt;

&lt;span class="n"&gt;logging&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;basicConfig&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;filename&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"app.log"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;level&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;logging&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;INFO&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nb"&gt;format&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"%(asctime)s - %(levelname)s - %(message)s"&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;process_users&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;users&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;logging&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;info&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Starting user processing"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;user&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;users&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
            &lt;span class="n"&gt;logging&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;info&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Processed user: %s"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

        &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="nc"&gt;KeyError&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;logging&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;warning&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"A user record is missing the name field"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;logging&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;info&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"User processing completed"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;


&lt;span class="n"&gt;users&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Alex"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Sarah"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"email"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"example@email.com"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="nf"&gt;process_users&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;users&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This example records the processing of each user and warns when a record is missing the expected field.&lt;/p&gt;

&lt;p&gt;Notice the use of &lt;code&gt;%s&lt;/code&gt; in the logging message.&lt;/p&gt;

&lt;p&gt;Python's logging module can format the message only when it needs to be emitted. This is generally preferable to constructing every message with an f-string, especially when debug messages are disabled.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Configure Logging for a Server Application
&lt;/h2&gt;

&lt;p&gt;When a Python application runs on a VPS, logs become especially useful because you may not be watching the terminal continuously.&lt;/p&gt;

&lt;p&gt;For example, you could use the following configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;logging&lt;/span&gt;

&lt;span class="n"&gt;logging&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;basicConfig&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;filename&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"/var/log/myapp/app.log"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;level&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;logging&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;INFO&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nb"&gt;format&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"%(asctime)s %(levelname)s %(name)s: %(message)s"&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;logger&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;logging&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getLogger&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;__name__&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;info&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Application started"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Before using this path, create the directory and make sure the application user has permission to write to it.&lt;/p&gt;

&lt;p&gt;For a production application, consider log rotation so that log files do not consume unlimited disk space.&lt;/p&gt;

&lt;p&gt;You should also avoid recording passwords, API keys, access tokens, or other sensitive information in your logs.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Check Logs When an Application Fails
&lt;/h2&gt;

&lt;p&gt;When your application runs on a Linux server, you can inspect its log file using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;tail -f /var/log/myapp/app.log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This displays new log entries as they are written.&lt;/p&gt;

&lt;p&gt;To search for error messages:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;grep &lt;span class="s2"&gt;"ERROR"&lt;/span&gt; /var/log/myapp/app.log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If your Python application runs through a systemd service, you can also check its logs with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo journalctl -u myapp.service -n 100
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace &lt;code&gt;myapp.service&lt;/code&gt; with your actual service name.&lt;/p&gt;

&lt;p&gt;These commands can help you investigate problems without repeatedly restarting the application.&lt;/p&gt;

&lt;h2&gt;
  
  
  8. Practice With a Small Project
&lt;/h2&gt;

&lt;p&gt;A useful way to learn logging is to add it to a script you already use.&lt;/p&gt;

&lt;p&gt;Try creating a Python program that:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Reads a CSV file.&lt;/li&gt;
&lt;li&gt;Records when processing starts.&lt;/li&gt;
&lt;li&gt;Logs the number of records processed.&lt;/li&gt;
&lt;li&gt;Records any rows that contain missing values.&lt;/li&gt;
&lt;li&gt;Writes a final summary to the log file.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Then deliberately introduce an error and check whether your logs provide enough information to understand what happened.&lt;/p&gt;

&lt;p&gt;This exercise will help you learn how logging works in a real application rather than only memorizing commands.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Logging is a practical Python skill that becomes increasingly important as your applications grow.&lt;/p&gt;

&lt;p&gt;It helps you understand what your code is doing, investigate unexpected behavior, and troubleshoot problems after deployment.&lt;/p&gt;

&lt;p&gt;If you're planning to run Python applications on a Linux server, you can explore &lt;a href="https://www.seimaxim.com/vps-hosting" rel="noopener noreferrer"&gt;Seimaxim VPS hosting&lt;/a&gt; when comparing server environments for your projects.&lt;/p&gt;

&lt;p&gt;The important thing is to start using logging early, choose meaningful log levels, and record enough information to understand failures without exposing sensitive data.&lt;/p&gt;

&lt;p&gt;For your next Python project, try replacing a few debugging &lt;code&gt;print()&lt;/code&gt; statements with structured logging. You'll quickly see the difference.&lt;/p&gt;

</description>
      <category>python</category>
      <category>debug</category>
      <category>machinelearning</category>
      <category>productivity</category>
    </item>
    <item>
      <title>How to Secure a Linux VPS: 7 Practical Steps for Beginners</title>
      <dc:creator>Arthur</dc:creator>
      <pubDate>Fri, 27 Nov 2026 15:16:53 +0000</pubDate>
      <link>https://dev.to/arthur_luca/how-to-secure-a-linux-vps-7-practical-steps-for-beginners-107h</link>
      <guid>https://dev.to/arthur_luca/how-to-secure-a-linux-vps-7-practical-steps-for-beginners-107h</guid>
      <description>&lt;p&gt;Hello, I'm Arthur. Setting up a Linux VPS is exciting, especially when you're preparing to launch a website or application.&lt;/p&gt;

&lt;p&gt;But before making your server publicly accessible, there are a few important security steps you should take.&lt;/p&gt;

&lt;p&gt;A server with weak passwords, unnecessary open ports, or outdated software can become an easy target for attackers.&lt;/p&gt;

&lt;p&gt;In this guide, I'll explain seven practical ways to improve the security of a Linux VPS without making the setup unnecessarily complicated.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Update Your Linux System
&lt;/h2&gt;

&lt;p&gt;One of the simplest ways to improve server security is to keep your operating system and installed packages updated.&lt;/p&gt;

&lt;p&gt;On Ubuntu or Debian, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo apt update
sudo apt upgrade
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first command refreshes the package information, while the second installs available updates.&lt;/p&gt;

&lt;p&gt;Security updates can fix vulnerabilities in system packages and applications.&lt;/p&gt;

&lt;p&gt;For production servers, review important updates and plan maintenance carefully, especially when an update requires a reboot.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Use SSH Keys Instead of Passwords
&lt;/h2&gt;

&lt;p&gt;SSH allows you to connect to your Linux server remotely.&lt;/p&gt;

&lt;p&gt;Password-based authentication can be vulnerable to brute-force attempts, especially when weak passwords are used.&lt;/p&gt;

&lt;p&gt;SSH keys provide a more secure authentication method.&lt;/p&gt;

&lt;p&gt;On your local computer, generate a key pair:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh-keygen -t ed25519
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This creates a public key and a private key.&lt;/p&gt;

&lt;p&gt;Copy the public key to your server:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh-copy-id username@your-server-ip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace &lt;code&gt;username&lt;/code&gt; and &lt;code&gt;your-server-ip&lt;/code&gt; with your actual server details.&lt;/p&gt;

&lt;p&gt;Test the connection in a new terminal before changing your SSH configuration.&lt;/p&gt;

&lt;p&gt;Never share your private key with anyone. Keep it protected on your own device.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Create a Separate User for Administration
&lt;/h2&gt;

&lt;p&gt;Using the root account for everyday tasks is not a good security practice.&lt;/p&gt;

&lt;p&gt;Instead, create a regular user:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo adduser adminuser
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Give the user administrative privileges:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo usermod -aG sudo adminuser
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can now perform administrative tasks using &lt;code&gt;sudo&lt;/code&gt; when necessary.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo apt update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This approach helps reduce the risk of accidentally making system-wide changes while working as root.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Configure a Firewall
&lt;/h2&gt;

&lt;p&gt;A firewall controls which network connections are allowed to reach your server.&lt;/p&gt;

&lt;p&gt;On Ubuntu, you can use UFW.&lt;/p&gt;

&lt;p&gt;Install it if necessary:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo apt install ufw
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Allow SSH connections before enabling the firewall:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo ufw allow OpenSSH
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If your server hosts a website, allow HTTP and HTTPS traffic:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Enable the firewall:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo ufw &lt;span class="nb"&gt;enable&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check the active rules:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo ufw status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Only open ports that your applications actually need.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; If your SSH service uses a custom port, allow that port before enabling the firewall. Otherwise, you could lose remote access to your server.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Disable Unnecessary Services
&lt;/h2&gt;

&lt;p&gt;Every service running on your server may introduce additional security risks.&lt;/p&gt;

&lt;p&gt;Check which services are currently listening for network connections:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo ss -tulpn
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command displays listening TCP and UDP ports along with the associated processes.&lt;/p&gt;

&lt;p&gt;If you find a service that you do not need, investigate it before disabling it.&lt;/p&gt;

&lt;p&gt;For example, you can check whether a service is running with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo systemctl status service-name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace &lt;code&gt;service-name&lt;/code&gt; with the actual service name.&lt;/p&gt;

&lt;p&gt;Do not disable services simply because you do not recognize them. Some are essential for your operating system or applications.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Protect Your Website With HTTPS
&lt;/h2&gt;

&lt;p&gt;If your VPS hosts a website, HTTPS encrypts the connection between your visitors and your server.&lt;/p&gt;

&lt;p&gt;Without HTTPS, information sent between a browser and a website may be exposed to interception.&lt;/p&gt;

&lt;p&gt;For a website using Nginx on Ubuntu, Certbot can help configure a TLS certificate.&lt;/p&gt;

&lt;p&gt;Install Certbot and its Nginx plugin:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo apt install certbot python3-certbot-nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Request a certificate:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo certbot --nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Follow the instructions and provide a domain that already points to your server.&lt;/p&gt;

&lt;p&gt;After setup, test that your website loads over HTTPS.&lt;/p&gt;

&lt;p&gt;You should also make sure certificate renewal is configured and working.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Monitor Your Server and Keep Backups
&lt;/h2&gt;

&lt;p&gt;Security is not a one-time task.&lt;/p&gt;

&lt;p&gt;Regular monitoring can help you identify unusual activity, while backups give you a way to recover from certain failures.&lt;/p&gt;

&lt;p&gt;Check recent authentication activity:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo journalctl -u ssh --since &lt;span class="s2"&gt;"24 hours ago"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Depending on your Linux distribution, SSH logs may use a different service name or be stored in a different location.&lt;/p&gt;

&lt;p&gt;You can also check failed login attempts and investigate unfamiliar activity.&lt;/p&gt;

&lt;p&gt;For backups, keep copies of your important website files, databases, and configuration files in a separate location.&lt;/p&gt;

&lt;p&gt;Test your restoration process regularly. A backup that cannot be restored is not very useful during an emergency.&lt;/p&gt;

&lt;h2&gt;
  
  
  Choosing a VPS for Your Website
&lt;/h2&gt;

&lt;p&gt;Security also depends on having a server environment that supports your application requirements.&lt;/p&gt;

&lt;p&gt;When comparing VPS hosting options, consider:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The operating system and available updates&lt;/li&gt;
&lt;li&gt;CPU, RAM, and storage resources&lt;/li&gt;
&lt;li&gt;Network connectivity and bandwidth&lt;/li&gt;
&lt;li&gt;Backup and recovery options&lt;/li&gt;
&lt;li&gt;Your ability to manage the server securely&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you're planning to deploy a website or application, you can explore &lt;a href="https://www.seimaxim.com/vps-hosting" rel="noopener noreferrer"&gt;Seimaxim VPS hosting&lt;/a&gt; to review available server options.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Securing a Linux VPS does not have to be complicated.&lt;/p&gt;

&lt;p&gt;Start by updating your system, protecting SSH access, configuring a firewall, and removing unnecessary services.&lt;/p&gt;

&lt;p&gt;Then add HTTPS, regular monitoring, and a reliable backup routine.&lt;/p&gt;

&lt;p&gt;These basic practices can help you build a more secure foundation for your website or application.&lt;/p&gt;

&lt;p&gt;The most important thing is to understand what each security setting does before changing it on a production server.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>beginners</category>
      <category>performance</category>
      <category>productivity</category>
    </item>
    <item>
      <title>How to Monitor a Linux VPS: CPU, RAM, Disk, and Network Usage</title>
      <dc:creator>Arthur</dc:creator>
      <pubDate>Fri, 27 Nov 2026 15:10:14 +0000</pubDate>
      <link>https://dev.to/arthur_luca/how-to-monitor-a-linux-vps-cpu-ram-disk-and-network-usage-2pgk</link>
      <guid>https://dev.to/arthur_luca/how-to-monitor-a-linux-vps-cpu-ram-disk-and-network-usage-2pgk</guid>
      <description>&lt;p&gt;Hello, I'm Arthur. Have you ever noticed your website becoming slow even though your server is still running?&lt;/p&gt;

&lt;p&gt;Sometimes the problem is not your application. Your VPS might be running out of memory, using too much CPU, or running low on disk space.&lt;/p&gt;

&lt;p&gt;Monitoring these resources can help you find problems before they affect your users.&lt;/p&gt;

&lt;p&gt;In this guide, we'll look at simple Linux commands that help you understand what's happening inside your VPS.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Check CPU and Memory Usage
&lt;/h2&gt;

&lt;p&gt;The first step is to check whether your server has enough resources for its current workload.&lt;/p&gt;

&lt;p&gt;Run this command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;top
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It displays running processes, CPU usage, memory consumption, and system load.&lt;/p&gt;

&lt;p&gt;You can also use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;free -h
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This shows how much RAM is available and how much is being used.&lt;/p&gt;

&lt;p&gt;For example, if your server has 8 GB of RAM and only a small amount is available, you may need to investigate which applications are consuming memory.&lt;/p&gt;

&lt;p&gt;Remember that Linux also uses available memory for caching, so low free memory does not always mean your server is running out of RAM. Check the available memory value as well.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Find Processes Using Too Much CPU
&lt;/h2&gt;

&lt;p&gt;A single process can sometimes consume most of your server's CPU resources.&lt;/p&gt;

&lt;p&gt;To find processes using the most CPU, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ps aux --sort=-%cpu &lt;span class="o"&gt;|&lt;/span&gt; head
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command lists the processes with the highest CPU usage.&lt;/p&gt;

&lt;p&gt;For example, a Python application running an inefficient loop might consume more CPU than expected.&lt;/p&gt;

&lt;p&gt;Before stopping a process, identify what it does. Some processes are essential for your operating system or application.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Check Disk Space Before It Becomes a Problem
&lt;/h2&gt;

&lt;p&gt;Running out of disk space can cause applications to fail, prevent logs from being written, and interrupt database operations.&lt;/p&gt;

&lt;p&gt;Check your disk usage with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;df -h
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This displays the available space on mounted filesystems.&lt;/p&gt;

&lt;p&gt;To find which directories are consuming the most space, use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo du -sh /var/log /var/www /home 2&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;/dev/null
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These directories commonly contain logs, website files, and user data.&lt;/p&gt;

&lt;p&gt;If a filesystem is nearly full, investigate large files before deleting anything. Removing active application files or database files can cause serious problems.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Monitor Network Activity
&lt;/h2&gt;

&lt;p&gt;A server can have sufficient CPU and RAM but still experience performance problems because of network traffic.&lt;/p&gt;

&lt;p&gt;To check your network interfaces and IP addresses, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ip -s link
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This displays received and transmitted traffic, along with packet errors and drops.&lt;/p&gt;

&lt;p&gt;If your website is slow, check whether the issue is related to network traffic, application performance, or server resources.&lt;/p&gt;

&lt;p&gt;For a more detailed investigation, tools such as &lt;code&gt;iftop&lt;/code&gt; and &lt;code&gt;nload&lt;/code&gt; can help you monitor network activity in real time.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Create a Simple Daily Resource Report
&lt;/h2&gt;

&lt;p&gt;You can combine Linux commands into a small script to record server usage.&lt;/p&gt;

&lt;p&gt;Create a file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nano server-report.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/bin/bash&lt;/span&gt;

&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Server Report: $(date)"&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"-------------------------"&lt;/span&gt;

&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"CPU and Load:"&lt;/span&gt;
uptime

&lt;span class="nb"&gt;echo&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Memory:"&lt;/span&gt;
free -h

&lt;span class="nb"&gt;echo&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Disk:"&lt;/span&gt;
df -h /

&lt;span class="nb"&gt;echo&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Top CPU Processes:"&lt;/span&gt;
ps aux --sort=-%cpu &lt;span class="o"&gt;|&lt;/span&gt; head -5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save the file and make it executable:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;chmod +x server-report.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run the script:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;./server-report.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also schedule it to run every day at 9 AM using cron:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;0 9 * * * /home/youruser/server-report.sh &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; /home/youruser/server-report.log 2&lt;span class="o"&gt;&amp;gt;&amp;amp;&lt;/span&gt;1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace &lt;code&gt;/home/youruser/&lt;/code&gt; with the actual path to your script.&lt;/p&gt;

&lt;p&gt;This gives you a simple historical record of resource usage. For production environments, a monitoring system with alerts is more useful because it can notify you when resources reach critical levels.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Choose the Right VPS Resources
&lt;/h2&gt;

&lt;p&gt;Monitoring helps you understand whether your current server is suitable for your workload.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A small website may work well with limited CPU and RAM.&lt;/li&gt;
&lt;li&gt;A database application may need more memory and faster storage.&lt;/li&gt;
&lt;li&gt;A Python application processing large datasets may benefit from additional CPU resources.&lt;/li&gt;
&lt;li&gt;A busy website may require more bandwidth and careful network monitoring.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you're planning to deploy a Python application or host a website, compare VPS plans based on their CPU, RAM, storage, bandwidth, and operating system options.&lt;/p&gt;

&lt;p&gt;You can explore &lt;a href="https://www.seimaxim.com/vps-hosting" rel="noopener noreferrer"&gt;Seimaxim VPS hosting&lt;/a&gt; to review available server options for your project.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Make Monitoring a Regular Habit
&lt;/h2&gt;

&lt;p&gt;Checking your server only when something goes wrong can make troubleshooting more difficult.&lt;/p&gt;

&lt;p&gt;A simple monitoring routine can help you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Identify unusual resource usage.&lt;/li&gt;
&lt;li&gt;Find storage problems before the disk becomes full.&lt;/li&gt;
&lt;li&gt;Understand whether your application needs more resources.&lt;/li&gt;
&lt;li&gt;Investigate performance issues with actual system data.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For larger applications, consider using monitoring tools such as Netdata, Prometheus, or Grafana to track resource usage over time.&lt;/p&gt;

&lt;p&gt;If you are comparing server options for a growing application, &lt;a href="https://www.seimaxim.com/vps-hosting" rel="noopener noreferrer"&gt;Seimaxim's VPS plans&lt;/a&gt; are another place to review available configurations.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;You don't need a complicated monitoring system to start understanding your Linux server.&lt;/p&gt;

&lt;p&gt;Commands such as &lt;code&gt;top&lt;/code&gt;, &lt;code&gt;free&lt;/code&gt;, &lt;code&gt;df&lt;/code&gt;, and &lt;code&gt;ps&lt;/code&gt; provide useful information about CPU, memory, storage, and running processes.&lt;/p&gt;

&lt;p&gt;Start with these basic checks, keep an eye on resource usage, and investigate unusual changes before they affect your application.&lt;/p&gt;

&lt;p&gt;A little monitoring today can save you a lot of troubleshooting later.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>vps</category>
      <category>cpu</category>
      <category>networking</category>
    </item>
    <item>
      <title>How to Automate Daily Tasks With Python and Cron on Linux</title>
      <dc:creator>Arthur</dc:creator>
      <pubDate>Fri, 27 Nov 2026 15:03:32 +0000</pubDate>
      <link>https://dev.to/arthur_luca/how-to-automate-daily-tasks-with-python-and-cron-on-linux-2n1n</link>
      <guid>https://dev.to/arthur_luca/how-to-automate-daily-tasks-with-python-and-cron-on-linux-2n1n</guid>
      <description>&lt;p&gt;Hello, I'm Arthur. Have you ever repeated the same task on your computer every day and wished it could run automatically?&lt;/p&gt;

&lt;p&gt;Maybe you need to back up files, check a website, or clean up old logs.&lt;/p&gt;

&lt;p&gt;Python and cron can help you automate these tasks on a Linux server without manually running a script every time.&lt;/p&gt;

&lt;p&gt;In this tutorial, we'll create a simple Python script and schedule it to run automatically.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Create a Python Script
&lt;/h2&gt;

&lt;p&gt;First, create a project directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mkdir daily-check
&lt;span class="nb"&gt;cd&lt;/span&gt; daily-check
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create a file named &lt;code&gt;check.py&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;datetime&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;datetime&lt;/span&gt;

&lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;datetime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="nb"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"daily_log.txt"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"a"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"Script ran at {now}\n"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Task completed"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This script records the date and time whenever it runs.&lt;/p&gt;

&lt;p&gt;Test it manually:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 check.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see a new file called &lt;code&gt;daily_log.txt&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Understand What Cron Does
&lt;/h2&gt;

&lt;p&gt;Cron is a Linux utility that runs commands automatically at scheduled times.&lt;/p&gt;

&lt;p&gt;For example, you can configure it to run a script every day, every hour, or at a specific time.&lt;/p&gt;

&lt;p&gt;This is useful for repetitive tasks such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Checking website availability&lt;/li&gt;
&lt;li&gt;Generating daily reports&lt;/li&gt;
&lt;li&gt;Running data processing scripts&lt;/li&gt;
&lt;li&gt;Cleaning temporary files&lt;/li&gt;
&lt;li&gt;Creating scheduled backups&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  3. Schedule Your Python Script
&lt;/h2&gt;

&lt;p&gt;Open your cron configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;crontab -e
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add the following line to run your script every day at 9 AM:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;0 9 * * * /usr/bin/python3 /home/youruser/daily-check/check.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace &lt;code&gt;/home/youruser/&lt;/code&gt; with the actual path to your project.&lt;/p&gt;

&lt;p&gt;Save the file and exit.&lt;/p&gt;

&lt;p&gt;Cron will now run the script at the scheduled time.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Check Whether the Script Worked
&lt;/h2&gt;

&lt;p&gt;After the scheduled time, check your log file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cat daily_log.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see a new entry with the date and time.&lt;/p&gt;

&lt;p&gt;If the script does not run, check the cron configuration and system logs.&lt;/p&gt;

&lt;p&gt;You can also redirect the script's output to a log file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;0 9 * * * /usr/bin/python3 /home/youruser/daily-check/check.py &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; /home/youruser/daily-check/cron.log 2&lt;span class="o"&gt;&amp;gt;&amp;amp;&lt;/span&gt;1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This makes it easier to troubleshoot errors.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Use Automation for Server Maintenance
&lt;/h2&gt;

&lt;p&gt;Once you understand the basics, you can use cron for more useful server tasks.&lt;/p&gt;

&lt;p&gt;For example, you could schedule a Python script to check whether your website is responding or generate a daily report about your application.&lt;/p&gt;

&lt;p&gt;If you're running these tasks on a remote VPS, make sure the server has enough resources and that your scripts handle errors properly.&lt;/p&gt;

&lt;p&gt;For developers comparing hosting options for Python applications, &lt;a href="https://www.seimaxim.com/vps-hosting" rel="noopener noreferrer"&gt;Seimaxim's VPS hosting services&lt;/a&gt; are worth exploring when choosing a server for scheduled tasks and other workloads.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Be Careful With Automated Tasks
&lt;/h2&gt;

&lt;p&gt;Automation saves time, but a script that runs repeatedly can also create problems if it is not configured properly.&lt;/p&gt;

&lt;p&gt;Before scheduling a task, make sure:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The script works when run manually.&lt;/li&gt;
&lt;li&gt;File paths are correct.&lt;/li&gt;
&lt;li&gt;Required permissions are available.&lt;/li&gt;
&lt;li&gt;Errors are logged.&lt;/li&gt;
&lt;li&gt;The task does not run more frequently than necessary.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For important tasks, test the script in a safe environment before scheduling it on a production server.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Python and cron are a useful combination for automating repetitive work on Linux.&lt;/p&gt;

&lt;p&gt;You can start with a simple script and gradually build more advanced tools for monitoring, reporting, and maintenance.&lt;/p&gt;

&lt;p&gt;Learning how to schedule tasks is a practical skill for anyone working with Python or managing a Linux server.&lt;/p&gt;

&lt;p&gt;If you need a remote environment for your Python projects, you can also explore &lt;a href="https://seimaxim.com/" rel="noopener noreferrer"&gt;Seimaxim&lt;/a&gt; for VPS hosting options.&lt;/p&gt;

</description>
      <category>python</category>
      <category>linux</category>
      <category>productivity</category>
      <category>programming</category>
    </item>
    <item>
      <title>How to Secure a Linux VPS: 7 Practical Steps for Beginners</title>
      <dc:creator>Arthur</dc:creator>
      <pubDate>Thu, 26 Nov 2026 18:24:05 +0000</pubDate>
      <link>https://dev.to/arthur_luca/how-to-secure-a-linux-vps-7-practical-steps-for-beginners-18</link>
      <guid>https://dev.to/arthur_luca/how-to-secure-a-linux-vps-7-practical-steps-for-beginners-18</guid>
      <description>&lt;p&gt;Hello, I'm Arthur. Setting up a VPS is exciting, especially when you're ready to deploy your first website or application.&lt;/p&gt;

&lt;p&gt;But before putting your project online, it's important to understand a few basic security practices.&lt;/p&gt;

&lt;p&gt;A newly configured server may have unnecessary services, weak passwords, or outdated software. Taking some time to secure it can help reduce common risks.&lt;/p&gt;

&lt;p&gt;Here are seven practical steps to get started.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Update Your System
&lt;/h2&gt;

&lt;p&gt;Start by installing available security updates.&lt;/p&gt;

&lt;p&gt;On Ubuntu or Debian, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo apt update
sudo apt upgrade
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Keeping your system updated helps ensure that known vulnerabilities are patched.&lt;/p&gt;

&lt;p&gt;For production servers, plan updates carefully and test important applications after major changes.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Use SSH Keys Instead of Passwords
&lt;/h2&gt;

&lt;p&gt;SSH keys provide a secure way to authenticate when connecting to your server.&lt;/p&gt;

&lt;p&gt;Generate a key pair on your local computer:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh-keygen -t ed25519
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Copy the public key to your server using a secure method.&lt;/p&gt;

&lt;p&gt;Once key-based access is tested, you can consider disabling SSH password authentication.&lt;/p&gt;

&lt;p&gt;Do not disable password authentication before confirming that your SSH key works. Otherwise, you may lose access to your server.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Create a Separate User
&lt;/h2&gt;

&lt;p&gt;Avoid using the root account for everyday tasks.&lt;/p&gt;

&lt;p&gt;Create a regular user:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo adduser deploy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Give the user administrative privileges only if needed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo usermod -aG sudo deploy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Using a separate account helps reduce the risk of accidentally making system-wide changes.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Configure a Firewall
&lt;/h2&gt;

&lt;p&gt;A firewall helps control which network connections can reach your server.&lt;/p&gt;

&lt;p&gt;On Ubuntu, you can use UFW.&lt;/p&gt;

&lt;p&gt;First, allow SSH:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo ufw allow OpenSSH
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then allow web traffic if your server hosts a website:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo ufw allow 80
sudo ufw allow 443
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Enable the firewall:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo ufw &lt;span class="nb"&gt;enable&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Before enabling a firewall on a remote server, make sure you have allowed the port used for SSH. Otherwise, you may disconnect yourself.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Remove Unnecessary Services
&lt;/h2&gt;

&lt;p&gt;Every service running on your server may introduce additional maintenance or security requirements.&lt;/p&gt;

&lt;p&gt;Check which services are running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;systemctl --type=service --state=running
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Review the output and identify services that your application does not need.&lt;/p&gt;

&lt;p&gt;Do not stop services simply because you do not recognize their names. Some are required for normal system operation.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Monitor Your Server Logs
&lt;/h2&gt;

&lt;p&gt;Logs can help you identify failed login attempts, application errors, and unusual activity.&lt;/p&gt;

&lt;p&gt;For example, on Ubuntu, you can review authentication logs with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo journalctl -u ssh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also check system logs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo journalctl -p warning
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Regularly reviewing logs can help you notice problems before they become serious.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Choose the Right VPS Configuration
&lt;/h2&gt;

&lt;p&gt;Security is not only about software. It also involves understanding the environment where your application runs.&lt;/p&gt;

&lt;p&gt;When selecting a VPS, consider:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Whether the provider offers a reliable management interface&lt;/li&gt;
&lt;li&gt;How backups and recovery are handled&lt;/li&gt;
&lt;li&gt;Whether you can configure the firewall&lt;/li&gt;
&lt;li&gt;How operating system updates are managed&lt;/li&gt;
&lt;li&gt;What access controls are available&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example, &lt;a href="https://www.seimaxim.com/vps-hosting" rel="noopener noreferrer"&gt;Seimaxim's VPS hosting services&lt;/a&gt; are worth exploring when comparing server options for a new application.&lt;/p&gt;

&lt;p&gt;Choose a configuration that matches your workload and gives you the control needed to maintain your server properly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Securing a Linux VPS does not have to be complicated.&lt;/p&gt;

&lt;p&gt;Start with system updates, secure SSH access, a properly configured firewall, and regular monitoring.&lt;/p&gt;

&lt;p&gt;These steps are a useful foundation, but security is an ongoing process. Keep your software updated, maintain backups, and review your server configuration as your application grows.&lt;/p&gt;

&lt;p&gt;If you're planning to deploy a website or application, you can also explore &lt;a href="https://seimaxim.com/" rel="noopener noreferrer"&gt;Seimaxim&lt;/a&gt; to compare VPS hosting options for your project.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>security</category>
      <category>vps</category>
      <category>beginners</category>
    </item>
    <item>
      <title>How to Deploy a Python Flask App on a VPS</title>
      <dc:creator>Arthur</dc:creator>
      <pubDate>Thu, 26 Nov 2026 18:19:57 +0000</pubDate>
      <link>https://dev.to/arthur_luca/how-to-deploy-a-python-flask-app-on-a-vps-4g3g</link>
      <guid>https://dev.to/arthur_luca/how-to-deploy-a-python-flask-app-on-a-vps-4g3g</guid>
      <description>&lt;p&gt;Hello, I'm Arthur. Building a Python application is one thing, but making it accessible online is another.&lt;/p&gt;

&lt;p&gt;A VPS gives you a remote server where you can install your application and run it independently of your personal computer.&lt;/p&gt;

&lt;p&gt;In this tutorial, we'll create a small Flask application and prepare it for deployment on a Linux VPS.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Create a Flask Application
&lt;/h2&gt;

&lt;p&gt;First, install Flask:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip install flask
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create a file called &lt;code&gt;app.py&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;flask&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nc"&gt;Flask&lt;/span&gt;

&lt;span class="n"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Flask&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;__name__&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="nd"&gt;@app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;route&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"/"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;home&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;"Hello from my Flask application!"&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;__name__&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;"__main__"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run the application:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python app.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your Flask app will start locally. Open the address shown in your terminal to test it.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Prepare Your VPS
&lt;/h2&gt;

&lt;p&gt;For this tutorial, you'll need a Linux VPS with SSH access.&lt;/p&gt;

&lt;p&gt;Connect to your server:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh username@your_server_ip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Install Python and the required tools using your distribution's package manager.&lt;/p&gt;

&lt;p&gt;For example, on Ubuntu:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo apt update
sudo apt install python3 python3-venv python3-pip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A VPS is useful when you want your application to run on a remote machine instead of relying on your personal computer.&lt;/p&gt;

&lt;p&gt;If you're comparing hosting options, &lt;a href="https://www.seimaxim.com/vps-hosting" rel="noopener noreferrer"&gt;Seimaxim's VPS hosting&lt;/a&gt; is one place to explore server configurations for Python projects.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Upload Your Application
&lt;/h2&gt;

&lt;p&gt;Create a project directory on the server:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mkdir my-flask-app
&lt;span class="nb"&gt;cd&lt;/span&gt; my-flask-app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Upload your &lt;code&gt;app.py&lt;/code&gt; file using SCP or another secure file transfer method.&lt;/p&gt;

&lt;p&gt;Create a virtual environment:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 -m venv venv
&lt;span class="nb"&gt;source&lt;/span&gt; venv/bin/activate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Install Flask:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip install flask
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Keeping dependencies in a virtual environment helps prevent conflicts between different Python projects.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Run the Application
&lt;/h2&gt;

&lt;p&gt;For a quick test, you can run the Flask development server:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python app.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;However, Flask's built-in development server is not intended for production use.&lt;/p&gt;

&lt;p&gt;For a real deployment, use a production WSGI server such as Gunicorn.&lt;/p&gt;

&lt;p&gt;Install it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip install gunicorn
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gunicorn --bind 127.0.0.1:8000 app:app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This starts the application on the local server interface at port 8000.&lt;/p&gt;

&lt;p&gt;A reverse proxy such as Nginx can then forward public web requests to Gunicorn.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Configure Your Domain and HTTPS
&lt;/h2&gt;

&lt;p&gt;If you want visitors to access your application through a domain name, configure the domain's DNS records to point to your server.&lt;/p&gt;

&lt;p&gt;You can then configure Nginx to forward requests to your Flask application.&lt;/p&gt;

&lt;p&gt;For public websites, HTTPS is essential for protecting information exchanged between the browser and your server.&lt;/p&gt;

&lt;p&gt;You can use a trusted certificate authority such as Let's Encrypt to obtain a certificate.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Deploying a Flask application on a VPS is a useful skill for Python developers.&lt;/p&gt;

&lt;p&gt;It helps you understand Linux, SSH, Python environments, application servers, and basic web hosting.&lt;/p&gt;

&lt;p&gt;Start with a small application, test it carefully, and add production features as your project grows.&lt;/p&gt;

&lt;p&gt;When you're ready to host your own application, you can also explore &lt;a href="https://seimaxim.com/" rel="noopener noreferrer"&gt;Seimaxim&lt;/a&gt; for VPS hosting options.&lt;/p&gt;

</description>
      <category>python</category>
      <category>flask</category>
      <category>vps</category>
      <category>performance</category>
    </item>
    <item>
      <title>How to Set Up a Python Web Server for Your First Project</title>
      <dc:creator>Arthur</dc:creator>
      <pubDate>Thu, 26 Nov 2026 18:15:54 +0000</pubDate>
      <link>https://dev.to/arthur_luca/how-to-set-up-a-python-web-server-for-your-first-project-2m1n</link>
      <guid>https://dev.to/arthur_luca/how-to-set-up-a-python-web-server-for-your-first-project-2m1n</guid>
      <description>&lt;p&gt;Hello, I'm Arthur. When I started learning Python, I used to think that building a website required a lot of complicated tools and frameworks.&lt;/p&gt;

&lt;p&gt;But one of the easiest ways to understand how web servers work is to build a small one yourself.&lt;/p&gt;

&lt;p&gt;In this tutorial, we'll create a simple Python web server, understand how it handles requests, and learn how to make it accessible from another computer.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Create a Simple Python Web Server
&lt;/h2&gt;

&lt;p&gt;Python includes a built-in HTTP server that you can use to serve files from a directory.&lt;/p&gt;

&lt;p&gt;First, create a folder for your project.&lt;/p&gt;

&lt;p&gt;Inside that folder, create a file named &lt;code&gt;index.html&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;My First Server&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Hello from my Python server!&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;This page is being served using Python.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now open your terminal in the same folder and run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python -m http.server 8000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your server will start listening on port 8000.&lt;/p&gt;

&lt;p&gt;Open your browser and visit:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;http://localhost:8000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see the HTML page you created.&lt;/p&gt;

&lt;p&gt;This is a simple way to understand how a web server delivers files to a browser.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Understand What Happens When You Open a Website
&lt;/h2&gt;

&lt;p&gt;When you open a website, your browser sends an HTTP request to a server.&lt;/p&gt;

&lt;p&gt;The server receives that request and sends back a response.&lt;/p&gt;

&lt;p&gt;The response may contain HTML, JSON, images, or other data.&lt;/p&gt;

&lt;p&gt;In our example, Python receives the browser's request and returns the files from the current directory.&lt;/p&gt;

&lt;p&gt;This is the basic idea behind many web applications, even when they use more advanced frameworks.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Make Your Server Accessible From Another Computer
&lt;/h2&gt;

&lt;p&gt;By default, Python's HTTP server is mainly intended for local testing.&lt;/p&gt;

&lt;p&gt;If you want to access it from another computer on the same network, you can bind it to all available network interfaces:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python -m http.server 8000 --bind 0.0.0.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then use your computer's local IP address from another device:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;http://YOUR_LOCAL_IP:8000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Make sure both devices are connected to the same network and that your firewall allows the connection.&lt;/p&gt;

&lt;p&gt;Do not expose this basic server directly to the public internet. It is intended for simple testing, not production hosting.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. When Should You Use a VPS?
&lt;/h2&gt;

&lt;p&gt;A local server is useful for learning and testing, but it stops being accessible when your computer shuts down or loses its network connection.&lt;/p&gt;

&lt;p&gt;If you want to run a web application continuously, a virtual private server can be a practical option.&lt;/p&gt;

&lt;p&gt;A VPS gives you a remote environment where you can install Python, configure your application, and keep it running independently of your personal computer.&lt;/p&gt;

&lt;p&gt;For example, &lt;a href="https://www.seimaxim.com/vps-hosting" rel="noopener noreferrer"&gt;Seimaxim's VPS hosting services&lt;/a&gt; are worth exploring when comparing server options for Python projects.&lt;/p&gt;

&lt;p&gt;Before choosing a VPS, consider the amount of RAM, CPU resources, storage, and network requirements your application needs.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Keep Your Python Project Organized
&lt;/h2&gt;

&lt;p&gt;As your application grows, keeping files organized becomes important.&lt;/p&gt;

&lt;p&gt;A simple project structure could look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;my-python-project/
├── app.py
├── requirements.txt
├── index.html
└── README.md
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;app.py&lt;/code&gt; file contains your Python code, while &lt;code&gt;requirements.txt&lt;/code&gt; lists the libraries your project needs.&lt;/p&gt;

&lt;p&gt;You can create a requirements file using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip freeze &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; requirements.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This makes it easier to recreate your development environment on another computer or server.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Building a simple Python web server is a useful exercise for anyone learning web development.&lt;/p&gt;

&lt;p&gt;It helps you understand HTTP requests, browser communication, and the role of a server in delivering a website.&lt;/p&gt;

&lt;p&gt;Once you are comfortable with the basics, you can move on to frameworks such as Flask or Django and learn how to deploy a real application.&lt;/p&gt;

&lt;p&gt;If you are planning to host a Python project online, you can also explore &lt;a href="https://seimaxim.com/" rel="noopener noreferrer"&gt;Seimaxim&lt;/a&gt; to compare VPS hosting options for your next project.&lt;/p&gt;

</description>
      <category>python</category>
      <category>performance</category>
      <category>server</category>
      <category>web</category>
    </item>
    <item>
      <title>How to Build a Python Script That Checks Website Response Time</title>
      <dc:creator>Arthur</dc:creator>
      <pubDate>Thu, 26 Nov 2026 18:12:32 +0000</pubDate>
      <link>https://dev.to/arthur_luca/how-to-build-a-python-script-that-checks-website-response-time-30o7</link>
      <guid>https://dev.to/arthur_luca/how-to-build-a-python-script-that-checks-website-response-time-30o7</guid>
      <description>&lt;p&gt;Hello, I'm Arthur. When working on websites, one of the first things I like to check is how quickly a page responds.&lt;/p&gt;

&lt;p&gt;A website can look perfectly fine but still take several seconds to load. This can affect the user experience, especially when someone is trying to access an important page.&lt;/p&gt;

&lt;p&gt;Instead of checking every URL manually, you can use Python to build a simple website response time checker.&lt;/p&gt;

&lt;p&gt;In this tutorial, we'll create a script that checks multiple URLs, measures their response times, and saves the results to a CSV file.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Install the Required Python Library
&lt;/h2&gt;

&lt;p&gt;We'll use the &lt;code&gt;requests&lt;/code&gt; library to send HTTP requests and measure how long each request takes.&lt;/p&gt;

&lt;p&gt;Install it using pip:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip install requests
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We'll also use Python's built-in &lt;code&gt;time&lt;/code&gt; and &lt;code&gt;csv&lt;/code&gt; modules, so there is no need to install additional packages for those.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Create a Simple Response Time Checker
&lt;/h2&gt;

&lt;p&gt;Create a new Python file called &lt;code&gt;website_checker.py&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Start with the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;

&lt;span class="n"&gt;url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"https://example.com"&lt;/span&gt;

&lt;span class="n"&gt;start_time&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;perf_counter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;end_time&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;perf_counter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;response_time&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;end_time&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;start_time&lt;/span&gt;

&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Status code:"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;status_code&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Response time:"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;response_time&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"seconds"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The script sends a request to the website and measures the time taken to receive the response.&lt;/p&gt;

&lt;p&gt;The status code tells you whether the request was successful or returned an error.&lt;/p&gt;

&lt;p&gt;The response time gives you an idea of how quickly the server responded.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Check Multiple Websites
&lt;/h2&gt;

&lt;p&gt;Checking one website is useful, but you can make the script more practical by checking several URLs.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;

&lt;span class="n"&gt;urls&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="s2"&gt;"https://example.com"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"https://www.python.org"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"https://www.wikipedia.org"&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;url&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;urls&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;start_time&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;perf_counter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

        &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

        &lt;span class="n"&gt;end_time&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;perf_counter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

        &lt;span class="n"&gt;response_time&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;end_time&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;start_time&lt;/span&gt;

        &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Status:"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;status_code&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Response time:"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;response_time&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;RequestException&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"Error:"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This version checks each URL and prints its response time.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;try&lt;/code&gt; and &lt;code&gt;except&lt;/code&gt; blocks help the script continue even if one website cannot be reached.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Save the Results to a CSV File
&lt;/h2&gt;

&lt;p&gt;If you want to compare website performance over time, saving the results is a useful next step.&lt;/p&gt;

&lt;p&gt;You can use Python's built-in &lt;code&gt;csv&lt;/code&gt; module.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;csv&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;

&lt;span class="n"&gt;urls&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="s2"&gt;"https://example.com"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"https://www.python.org"&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="nb"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"website_results.csv"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"w"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;newline&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;writer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;csv&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;writer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;writer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;writerow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="s2"&gt;"Website"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"Status Code"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"Response Time"&lt;/span&gt;
    &lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;url&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;urls&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;start_time&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;perf_counter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

            &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

            &lt;span class="n"&gt;end_time&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;perf_counter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

            &lt;span class="n"&gt;response_time&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
                &lt;span class="n"&gt;end_time&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;start_time&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;
            &lt;span class="p"&gt;)&lt;/span&gt;

            &lt;span class="n"&gt;writer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;writerow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
                &lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;status_code&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="n"&gt;response_time&lt;/span&gt;
            &lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

        &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;RequestException&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;writer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;writerow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
                &lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="s2"&gt;"Error"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="s2"&gt;"N/A"&lt;/span&gt;
            &lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After running the script, you'll find a file named &lt;code&gt;website_results.csv&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;You can open it in Excel or Google Sheets to compare the results.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Understand What Response Time Actually Means
&lt;/h2&gt;

&lt;p&gt;One important thing to remember is that this script measures the time taken for an HTTP request to complete.&lt;/p&gt;

&lt;p&gt;It does not measure every part of a visitor's experience.&lt;/p&gt;

&lt;p&gt;For example, a browser may need additional time to download images, execute JavaScript, or render a page.&lt;/p&gt;

&lt;p&gt;The response time can also change depending on network conditions, server load, and the location from which the request is made.&lt;/p&gt;

&lt;p&gt;If you're comparing hosting options, it's useful to test from a consistent location and repeat the measurements.&lt;/p&gt;

&lt;p&gt;For projects that need reliable server performance, you can also compare &lt;a href="https://helloserver.tech/" rel="noopener noreferrer"&gt;HelloServer's hosting services&lt;/a&gt; and consider the hardware and network requirements of your application.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Building a website response time checker is a practical way to improve your Python skills.&lt;/p&gt;

&lt;p&gt;It teaches you how to send HTTP requests, measure execution time, handle errors, and save data for later analysis.&lt;/p&gt;

&lt;p&gt;You can extend this project by checking response times at regular intervals or creating a graph from the collected results.&lt;/p&gt;

&lt;p&gt;Start with a few URLs, understand the results, and gradually add more features as your skills improve.&lt;/p&gt;

</description>
      <category>python</category>
      <category>programming</category>
      <category>productivity</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
