{"id":2022,"date":"2025-09-08T01:42:06","date_gmt":"2023-09-07T16:50:10","guid":{"rendered":""},"modified":"2025-02-02T00:46:18","modified_gmt":"2025-02-01T23:46:18","slug":"how-to-install-cockroachdb-cluster-on-ubuntu-24-04","status":"publish","type":"post","link":"https:\/\/netcloud24.com\/knowledgebase\/how-to-install-cockroachdb-cluster-on-ubuntu-24-04\/","title":{"rendered":"Linux VPS &#038; VPS Windows Setup Guide | NetCloud24 CockroachDB Cluster on Ubuntu 24.04"},"content":{"rendered":"<p>\u00a0<\/p>\n<\/p>\n<header>\n<h1>\u00a0<\/h1>\n<\/header>\n<section>\n<p>CockroachDB is a powerful, open-source distributed SQL database designed for cloud applications. Installing a CockroachDB cluster on Ubuntu 24.04 can enhance your application&#8217;s scalability and resilience. This guide will walk you through the installation process on your <strong>VPS server<\/strong>. For reliable hosting solutions, consider using <a href=\"https:\/\/ie.netcloud24.com\" target=\"_blank\" rel=\"follow\">windowsvps<\/a> for your next <strong>VPS server<\/strong> deployment.<\/p>\n<h2>Prerequisites<\/h2>\n<p>Before you begin, ensure that you have the following:<\/p>\n<ul>\n<li>A <strong>VPS server<\/strong> running Ubuntu 24.04.<\/li>\n<li>Root or sudo access to the server.<\/li>\n<li>At least 2 GB of RAM and 2 CPU cores for each node.<\/li>\n<\/ul>\n<h2>Step 1: Update Your System<\/h2>\n<p>Start by updating your package list and installed packages:<\/p>\n<pre><code>sudo apt update &amp;&amp; sudo apt upgrade -y<\/code><\/pre>\n<h2>Step 2: Install CockroachDB<\/h2>\n<p>Download the latest stable version of CockroachDB:<\/p>\n<pre><code>wget https:\/\/binaries.cockroachdb.com\/cockroach-v22.1.6.linux-amd64.tgz<\/code><\/pre>\n<p>Extract the downloaded archive:<\/p>\n<pre><code>tar -xzvf cockroach-v22.1.6.linux-amd64.tgz<\/code><\/pre>\n<p>Move the Cockroach binary to the appropriate location:<\/p>\n<pre><code>sudo cp cockroach-v22.1.6.linux-amd64\/cockroach \/usr\/local\/bin\/<\/code><\/pre>\n<p>Make the Cockroach binary executable:<\/p>\n<pre><code>sudo chmod +x \/usr\/local\/bin\/cockroach<\/code><\/pre>\n<h2>Step 3: Start the CockroachDB Cluster<\/h2>\n<p>To start a single-node CockroachDB cluster, run:<\/p>\n<pre><code>cockroach start --insecure --listen-addr=localhost:26257 --http-port=8080 --store=store=path\/to\/store<\/code><\/pre>\n<p>Make sure to replace <code>path\/to\/store<\/code> with a directory where you want to store the data.<\/p>\n<h2>Step 4: Initialize the Database<\/h2>\n<p>In a new terminal window, initialize the database by running:<\/p>\n<pre><code>cockroach init --insecure --host=localhost:26257<\/code><\/pre>\n<h2>Step 5: Access the CockroachDB Admin UI<\/h2>\n<p>You can access the CockroachDB Admin UI by navigating to <code>http:\/\/localhost:8080<\/code> in your web browser.<\/p>\n<h2>Step 6: Joining Additional Nodes (Optional)<\/h2>\n<p>If you want to add more nodes to your cluster, run the following command on each additional node:<\/p>\n<pre><code>cockroach start --insecure --join=localhost:26257 --listen-addr=:26257 --http-port=8080 --store=path\/to\/store<\/code><\/pre>\n<p>Replace <code>&lt;node_ip&gt;<\/code> with the actual IP address of the node you are adding.<\/p>\n<h2>Step 7: Configure CockroachDB as a Service (Optional)<\/h2>\n<p>To run CockroachDB as a service, create a systemd service file:<\/p>\n<pre><code>sudo nano \/etc\/systemd\/system\/cockroach.service<\/code><\/pre>\n<p>Add the following configuration:<\/p>\n<pre><code>[Unit]\r\nDescription=CockroachDB\r\nAfter=network.target\r\n\r\n[Service]\r\nUser=root\r\nExecStart=\/usr\/local\/bin\/cockroach s\r\n<\/code><\/pre>\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 CockroachDB is a powerful, open-source distributed SQL database designed for cloud applications. Installing a CockroachDB cluster on Ubuntu 24.04 can enhance your application&#8217;s scalability and resilience.\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-2022","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\/2022","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=2022"}],"version-history":[{"count":0,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/2022\/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=2022"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/categories?post=2022"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/tags?post=2022"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}