{"id":2668,"date":"2023-03-08T09:58:13","date_gmt":"2022-09-17T21:26:54","guid":{"rendered":""},"modified":"2025-02-02T00:46:19","modified_gmt":"2025-02-01T23:46:19","slug":"how-to-install-visual-studio-code-cloud-ide-on-ubuntu-24-04-server","status":"publish","type":"post","link":"https:\/\/netcloud24.com\/knowledgebase\/how-to-install-visual-studio-code-cloud-ide-on-ubuntu-24-04-server\/","title":{"rendered":"Linux VPS &#038; VPS Windows Setup Guide | NetCloud24 Visual Studio Code Cloud IDE on Ubuntu 24.04 Server"},"content":{"rendered":"<p>\u00a0<\/p>\n<\/p>\n<header><\/header>\n<section>\n<p><strong>Visual Studio Code (VS Code)<\/strong> is a popular code editor that offers a Cloud IDE experience for remote development, allowing developers to work on their projects from anywhere. By installing VS Code as a Cloud IDE on an Ubuntu 24.04 server, you can access a full-featured coding environment in your browser. This guide will walk you through how to install and set up Visual Studio Code Cloud IDE on Ubuntu 24.04 Server, perfect for <strong>VPS server<\/strong> environments.<\/p>\n<h2>Step 1: Update Your System<\/h2>\n<p>Before installing Visual Studio Code, ensure your server is up to date. Run the following commands to update your package list and install any available updates:<\/p>\n<pre><code>sudo apt update &amp;&amp; sudo apt upgrade -y<\/code><\/pre>\n<h2>Step 2: Install Docker<\/h2>\n<p>To run VS Code as a Cloud IDE, we will use <strong>code-server<\/strong>, an open-source project that allows Visual Studio Code to run in the cloud. First, you need to install Docker, which will help you manage the code-server container. Run the following command to install Docker:<\/p>\n<pre><code>sudo apt install docker.io -y<\/code><\/pre>\n<p>Once Docker is installed, start and enable Docker:<\/p>\n<pre><code>sudo systemctl start docker\r\nsudo systemctl enable docker<\/code><\/pre>\n<h2>Step 3: Install VS Code Cloud IDE Using code-server<\/h2>\n<p>Next, pull the latest <strong>code-server<\/strong> Docker image from the official repository:<\/p>\n<pre><code>sudo docker pull codercom\/code-server:latest<\/code><\/pre>\n<p>Now, create a directory for your project files and start the code-server container. Replace <code>\/home\/username\/projects<\/code> with the directory where you want to store your projects:<\/p>\n<pre><code>\r\nsudo docker run -d -p 8080:8080 \\\r\n-v \/home\/username\/projects:\/home\/coder\/project \\\r\ncodercom\/code-server:latest\r\n        <\/code><\/pre>\n<p>This command will run VS Code on port 8080 and mount the specified directory as your workspace.<\/p>\n<h2>Step 4: Configure SSL (Optional)<\/h2>\n<p>If you&#8217;re running Visual Studio Code on a public-facing <strong>VPS server<\/strong>, it&#8217;s important to secure it with SSL. You can use Let&#8217;s Encrypt and Nginx to set up a secure connection. First, install Nginx and Certbot:<\/p>\n<pre><code>sudo apt install nginx certbot python3-certbot-nginx -y<\/code><\/pre>\n<p>Next, configure Nginx as a reverse proxy for VS Code:<\/p>\n<pre><code>sudo nano \/etc\/nginx\/sites-available\/vscode<\/code><\/pre>\n<p>Add the following configuration:<\/p>\n<pre><code>\r\nserver {\r\n    listen 80;\r\n    server_name your_domain;\r\n\r\n    location \/ {\r\n        proxy_pass http:\/\/localhost:8080;\r\n        proxy_set_header Host $host;\r\n        proxy_set_header X-Real-IP $remote_addr;\r\n        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\r\n        proxy_set_header X-Forwarded-Proto $scheme;\r\n    }\r\n}\r\n        <\/code><\/pre>\n<p>Save and exit the file, then enable the configuration:<\/p>\n<pre><code>\r\nsudo ln -s \/etc\/nginx\/sites-available\/vscode \/etc\/nginx\/sites-enabled\/\r\nsudo systemctl restart nginx\r\n        <\/code><\/pre>\n<p>Now, obtain a free SSL certificate from Let&#8217;s Encrypt:<\/p>\n<pre><code>sudo certbot --nginx -d your_domain<\/code><\/pre>\n<p>Follow the prompts to complete the SSL setup. Your VS Code Cloud IDE will now be accessible securely via HTTPS.<\/p>\n<h2>Step 5: Access VS Code Cloud IDE<\/h2>\n<p>Once the container is running and Nginx is configured (if applicable), you can access Visual Studio Code in your browser. Navigate to:<\/p>\n<pre><code>http:\/\/your_domain_or_server_ip:8080<\/code><\/pre>\n<p>If you secured the installation with SSL, use HTTPS:<\/p>\n<pre><code>https:\/\/your_domain<\/code><\/pre>\n<p>On the first login, code-server will ask you to set a password. After setting your password, you can log in and start coding!<\/p>\n<h2>Step 6: Configure Persistence for Data<\/h2>\n<p>If you&#8217;re running VS Code on a <strong>VPS server<\/strong>, it&#8217;s important to ensure your project files are persistent across container restarts. By mounting a volume as shown in Step 3 (<code>\/home\/username\/projects:\/home\/coder\/project<\/code>), your data will persist even if the Docker container is restarted or recreated.<\/p>\n<h2>Step 7: Enable Automatic Restart<\/h2>\n<p>To ensure that code-server starts automatically when the server reboots, you can add the <code>--restart always<\/code> flag to your Docker run command:<\/p>\n<pre><code>\r\nsudo docker run -d -p 8080:8080 \\\r\n-v \/home\/username\/projects:\/home\/coder\/project \\\r\n--restart always \\\r\ncodercom\/code-server:latest\r\n        <\/code><\/pre>\n<h2>Running VS Code Cloud IDE on a VPS Server<\/h2>\n<p>Running Visual Studio Code Cloud IDE on a <strong>VPS server<\/strong> offers flexibility and the ability to code from anywhere, while keeping all your project files hosted remotely. It&#8217;s perfect for developers working on collaborative projects or needing a robust, centralized development environment.<\/p>\n<h2>Looking for a Reliable VPS Solution?<\/h2>\n<p>If you&#8217;re looking for a reliable and scalable <strong>VPS server<\/strong> to run Visual Studio Code Cloud IDE, consider using . With <strong>Windows VPS<\/strong>, you get high-performance VPS hosting with full control over your development environment, making it perfect for hosting remote IDEs like VS Code.<\/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 Visual Studio Code (VS Code) is a popular code editor that offers a Cloud IDE experience for remote development, allowing developers to work on their projects from\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-2668","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\/2668","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=2668"}],"version-history":[{"count":0,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/2668\/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=2668"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/categories?post=2668"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/tags?post=2668"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}