{"id":1992,"date":"2023-12-18T07:03:42","date_gmt":"2024-02-02T07:13:58","guid":{"rendered":""},"modified":"2025-02-02T00:46:17","modified_gmt":"2025-02-01T23:46:17","slug":"how-to-install-and-configure-rsyslog-server-and-client-on-ubuntu-24-04","status":"publish","type":"post","link":"https:\/\/netcloud24.com\/knowledgebase\/how-to-install-and-configure-rsyslog-server-and-client-on-ubuntu-24-04\/","title":{"rendered":"Linux VPS &#038; VPS Windows Setup Guide | NetCloud24 and Configure Rsyslog Server and Client on Ubuntu 24.04"},"content":{"rendered":"<p>\u00a0<\/p>\n<\/p>\n<header>\n<h1>\u00a0<\/h1>\n<\/header>\n<section>\n<p><strong>Rsyslog<\/strong> is a powerful and flexible logging utility for forwarding log messages across systems. It can be used to centralize logs from multiple servers into a single location, making it easier to monitor, analyze, and troubleshoot. In this guide, we will walk you through how to install and configure both an Rsyslog server and client on Ubuntu 24.04. This setup is ideal for managing logs on <strong>VPS servers<\/strong> or any network environment.<\/p>\n<h2>Step 1: Update Your System<\/h2>\n<p>Before starting, ensure your Ubuntu 24.04 system is up to date. Open a terminal and run the following commands:<\/p>\n<pre><code>sudo apt update &amp;&amp; sudo apt upgrade -y<\/code><\/pre>\n<h2>Step 2: Install Rsyslog<\/h2>\n<p>Rsyslog is typically installed by default on most Linux distributions, but if it&#8217;s not, you can install it using the following command:<\/p>\n<pre><code>sudo apt install rsyslog -y<\/code><\/pre>\n<p>After installation, start and enable the Rsyslog service to ensure it runs at boot:<\/p>\n<pre><code>\r\nsudo systemctl start rsyslog\r\nsudo systemctl enable rsyslog\r\n        <\/code><\/pre>\n<h2>Step 3: Configure Rsyslog as a Server<\/h2>\n<p>To set up your server to receive logs from other clients, you need to modify the Rsyslog configuration file. Open the Rsyslog configuration file for editing:<\/p>\n<pre><code>sudo nano \/etc\/rsyslog.conf<\/code><\/pre>\n<p>Uncomment the following lines to enable UDP and TCP reception of log messages:<\/p>\n<pre><code>\r\n# Provides UDP syslog reception\r\nmodule(load=\"imudp\")\r\ninput(type=\"imudp\" port=\"514\")\r\n\r\n# Provides TCP syslog reception\r\nmodule(load=\"imtcp\")\r\ninput(type=\"imtcp\" port=\"514\")\r\n        <\/code><\/pre>\n<p>Save and exit the file, then restart Rsyslog to apply the changes:<\/p>\n<pre><code>sudo systemctl restart rsyslog<\/code><\/pre>\n<h2>Step 4: Configure Rsyslog on the Client<\/h2>\n<p>On the client machine, Rsyslog must be configured to forward logs to the Rsyslog server. First, open the Rsyslog configuration file on the client:<\/p>\n<pre><code>sudo nano \/etc\/rsyslog.conf<\/code><\/pre>\n<p>Add the following line at the bottom of the file to send logs to the server via UDP (replace <code>server_ip<\/code> with the actual IP address of your Rsyslog server):<\/p>\n<pre><code>*.* @server_ip:514<\/code><\/pre>\n<p>If you prefer to send logs via TCP, use this line instead:<\/p>\n<pre><code>*.* @@server_ip:514<\/code><\/pre>\n<p>Save and exit the file, then restart Rsyslog on the client:<\/p>\n<pre><code>sudo systemctl restart rsyslog<\/code><\/pre>\n<h2>Step 5: Verify the Configuration<\/h2>\n<p>To verify that the client is successfully sending logs to the server, check the server\u2019s log files. Logs from the client should appear in the default log directory, typically located at <code>\/var\/log<\/code>.<\/p>\n<p>On the server, you can check if logs are being received by monitoring the syslog file:<\/p>\n<pre><code>sudo tail -f \/var\/log\/syslog<\/code><\/pre>\n<p>If logs from the client are appearing in the server&#8217;s syslog, the configuration is working correctly.<\/p>\n<h2>Step 6: Securing the Rsyslog Server<\/h2>\n<p>Since Rsyslog is transmitting logs across the network, it is recommended to secure the connection using TLS encryption. This step is optional but highly recommended, especially for <strong>VPS servers<\/strong> that handle sensitive information.<\/p>\n<h3>Install TLS Certificates<\/h3>\n<p>First, generate or obtain a TLS certificate and key pair for the Rsyslog server. You can use Let&#8217;s Encrypt or any other certificate authority.<\/p>\n<p>Once you have the certificates, configure Rsyslog to use TLS. Open the Rsyslog configuration file and add the following lines:<\/p>\n<pre><code>\r\n# Enable TLS\r\n$DefaultNetstreamDriverCAFile \/etc\/ssl\/certs\/ca-certificates.crt\r\n$DefaultNetstreamDriverCertFile \/etc\/ssl\/certs\/your_certificate.pem\r\n$DefaultNetstreamDriverKeyFile \/etc\/ssl\/private\/your_private_key.key\r\n$ActionSendStreamDriver gtls # use gtls netstream driver\r\n$ActionSendStreamDriverMode 1 # require TLS\r\n$ActionSendStreamDriverAuthMode anon\r\n        <\/code><\/pre>\n<p>After saving the configuration, restart Rsyslog on both the server and client to apply the changes:<\/p>\n<pre><code>sudo systemctl restart rsyslog<\/code><\/pre>\n<h2>Step 7: Monitoring Logs on a VPS Server<\/h2>\n<p>If you&#8217;re running multiple <strong>VPS servers<\/strong>, centralizing your logs with Rsyslog allows for easier log monitoring and troubleshooting. By sending logs from all your VPS instances to a single Rsyslog server, you can efficiently monitor server activity, detect issues, and maintain system health from a central point.<\/p>\n<h2>Looking for a Reliable VPS Solution?<\/h2>\n<p>For those managing logs across multiple servers, a reliable and scalable <strong>VPS server<\/strong> is essential. If you&#8217;re looking for high-performance VPS hosting, consider . With <strong>Windows VPS<\/strong>, you get full control over your server environment, making it ideal for centralizing logs and managing server infrastructure efficiently.<\/p>\n<footer>\n<p>For more VPS server solutions and guides, visit <a href=\"https:\/\/ie.netcloud24.com\" target=\"_blank\" rel=\"follow\">netcloud24.com<\/a>.<\/p>\n<\/footer>\n<\/section>\n<div class=\"post-author-box\" style=\"border-top:1px solid #ddd;margin-top:20px;padding-top:15px;\">\n<p><strong>Author:<\/strong> \u0141ukasz Bodziony<\/p>\n<p><strong>Website:<\/strong> <a href=\"https:\/\/ca.netcloud24.com\" target=\"_blank\" rel=\"dofollow\">Windows VPS<\/a><\/p>\n<p><em>\u0141ukasz Bodziony is the CEO and founder of <a href=\"https:\/\/netcloud24.com\" target=\"_blank\" rel=\"dofollow\">NETCLOUD24<\/a>, a global VPS hosting brand proudly originating from Poland. With extensive experience in cloud computing, virtualization, and server management, he delivers high-performance <strong>Windows VPS<\/strong> and <strong>Remote Desktop Services (RDS)<\/strong> solutions to clients across Europe, North America, and beyond.<\/em><\/p>\n<p><em>His expertise covers a wide range of technologies, including <strong>Microsoft Azure<\/strong>, <strong>Proxmox VE<\/strong>, <strong>Amazon Web Services (AWS)<\/strong>, and numerous other virtualization and cloud platforms.<\/em><\/p>\n<p><em>Beyond running his hosting business, \u0141ukasz also provides <strong>professional paid server configuration and optimization services<\/strong> for companies and individuals. Outside of work, he is dedicated to caring for his children and building a secure future for them.<\/em><\/p>\n<p><em>If you are interested in working with him or need expert assistance with your hosting, cloud environment, or server setup, feel free to reach out via <a href=\"https:\/\/ca.netcloud24.com\" target=\"_blank\" rel=\"dofollow\">Windows VPS<\/a>.<\/em><\/p>\n<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u00a0 \u00a0 Rsyslog is a powerful and flexible logging utility for forwarding log messages across systems. It can be used to centralize logs from multiple servers into a\u2026<\/p>\n","protected":false},"author":1,"featured_media":3421,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_seopress_robots_primary_cat":"","_seopress_titles_title":"","_seopress_titles_desc":"","_seopress_robots_index":"","footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[],"tags":[14,12,11,23,20,21,22,17,7,8,6,10,18,19,15,24,16,5,13,9],"class_list":["post-1992","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","tag-cheapvps","tag-cloudvps","tag-hostingvps","tag-rds","tag-rdscal","tag-remotedesktop","tag-remotedesktopvps","tag-servervps","tag-ukvps","tag-virtualserver","tag-vpshosting","tag-vpsserver","tag-vpssolutions","tag-vpswindows","tag-vpswithwindows","tag-windowsrds","tag-windowsserver","tag-windowsvps","tag-windowsvpshosting","tag-windowsvpsuk"],"jetpack_publicize_connections":[],"_links":{"self":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1992","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/comments?post=1992"}],"version-history":[{"count":0,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1992\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/media\/3421"}],"wp:attachment":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/media?parent=1992"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/categories?post=1992"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/tags?post=1992"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}