<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Application Archives - ServerStadium</title>
	<atom:link href="https://serverstadium.com/knowledge-base/tag/application/feed/" rel="self" type="application/rss+xml" />
	<link>https://serverstadium.com/knowledge-base/tag/application/</link>
	<description>Public Cloud Solution by ServerStadium</description>
	<lastBuildDate>Thu, 27 Apr 2023 13:28:18 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.4</generator>

<image>
	<url>https://serverstadium.com/wp-content/uploads/2023/04/cropped-favicon-1-32x32.png</url>
	<title>Application Archives - ServerStadium</title>
	<link>https://serverstadium.com/knowledge-base/tag/application/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>VS Code on your browser! How to install code-server on a VM</title>
		<link>https://serverstadium.com/knowledge-base/vs-code-on-your-browser-how-to-install-code-server-on-a-vm/</link>
		
		<dc:creator><![CDATA[Brian K]]></dc:creator>
		<pubDate>Tue, 11 Oct 2022 09:57:17 +0000</pubDate>
				<guid isPermaLink="false">https://cloudraya.com/knowledge-base/?p=2749</guid>

					<description><![CDATA[<p>TLDR Guide Access the VS Code via SSH Tunnel on 8080:127.0.0.1:8080, then open your browser. Enjoy! Introduction Did you know that you can have your very own VS Code server that can be accessed anywhere on your browser? This way, your development environment is no longer dependent on your device. And If you have a&#8230;</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/vs-code-on-your-browser-how-to-install-code-server-on-a-vm/">VS Code on your browser! How to install code-server on a VM</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">TLDR Guide</h2>



<pre class="wp-block-code has-cyan-bluish-gray-background-color has-background"><code>sudo useradd -m -G sudo -s /bin/bash devel
sudo passwd devel
sudo su - devel
# as devel user #
curl -fsSL https://code-server.dev/install.sh | sudo sh
systemctl enable --now code-server@$USER</code></pre>



<p class="wp-block-paragraph">Access the VS Code via SSH Tunnel on <code>8080:127.0.0.1:8080</code>, then open your browser. Enjoy!</p>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Introduction</h2>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img fetchpriority="high" decoding="async" class="wp-image-2750" src="https://serverstadium.com/wp-content/uploads/2022/10/image.png" alt="" width="991" height="553" srcset="https://serverstadium.com/wp-content/uploads/2022/10/image.png 1321w, https://serverstadium.com/wp-content/uploads/2022/10/image-300x167.png 300w, https://serverstadium.com/wp-content/uploads/2022/10/image-1024x571.png 1024w, https://serverstadium.com/wp-content/uploads/2022/10/image-768x428.png 768w" sizes="(max-width: 991px) 100vw, 991px" />
<figcaption>VS Code in a browser!</figcaption>
</figure>
</div>


<p class="wp-block-paragraph">Did you know that you can have your very own VS Code server that can be accessed anywhere on your browser? This way, your development environment is no longer dependent on your device. And If you have a low-end PC/Mac/Laptop, running VS Code locally will burden your machine and will run very slowly.</p>



<p class="wp-block-paragraph">So, let&#8217;s jump into it!</p>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Preparation</h2>



<p class="wp-block-paragraph">In this article, the VS Code server will be running locally on the server. So, by default, public access is not available. So how would you access it? You can choose any of the following options:</p>



<ol class="wp-block-list">
<li>Using an SSH tunnel.</li>
<li>Using a reverse proxy with basic HTTP authentication.</li>
<li>Using ServerStadium&#8217;s VPN or your own VPN server.</li>
</ol>



<p class="wp-block-paragraph">I will only explain the first option.</p>



<h3 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">System requirements</h3>



<p class="wp-block-paragraph">The official minimal system requirements are:</p>



<ul class="wp-block-list">
<li>1 GB of RAM</li>
<li>2 vCPUs</li>
</ul>



<p class="wp-block-paragraph">You can use any Linux distribution of your choice, but I will show you how to deploy it on an Ubuntu server.</p>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Installation Steps</h2>



<p class="wp-block-paragraph"><strong>Step 1.</strong> Log in to your server. Assuming it&#8217;s a freshly deployed server, always update the packages.</p>



<p class="wp-block-paragraph"><strong>Step 2.</strong> Create a new user. Let&#8217;s call it <code>devel</code> and set a password for it. Also, make sure it&#8217;s a sudoer.</p>



<pre class="wp-block-code has-cyan-bluish-gray-background-color has-background"><code># useradd -m -G sudo -s /bin/bash devel
# passwd devel</code></pre>



<p class="wp-block-paragraph"><strong>Step 3. </strong>As the <code>devel</code> user (and from now on), install <code>code-server</code> by running the following command:</p>



<pre class="wp-block-code has-cyan-bluish-gray-background-color has-background"><code>curl -fsSL https://code-server.dev/install.sh | sudo sh</code></pre>



<p class="wp-block-paragraph"><strong>Step 4.</strong> Start the <code>code-server</code> service and enable it on boot.</p>



<pre class="wp-block-code has-cyan-bluish-gray-background-color has-background"><code>sudo systemctl enable --now code-server@$USER</code></pre>



<p class="wp-block-paragraph"><strong>Step 5. </strong>Ensure it&#8217;s running by doing the following command:</p>



<pre class="wp-block-code has-cyan-bluish-gray-background-color has-background"><code>ss -tulpn | grep 8080</code></pre>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img decoding="async" class="wp-image-2751" src="https://serverstadium.com/wp-content/uploads/2022/10/image-1.png" alt="" width="755" height="44" />
<figcaption>code-server is listening on port 8080</figcaption>
</figure>
</div>


<p class="wp-block-paragraph"><strong>Step 6.</strong> Open <code>~/.config/code-server/config.yaml</code> to get the login password.</p>



<p class="wp-block-paragraph"><strong>Step 7.</strong> Done.</p>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Accessing via SSH Tunnel</h2>



<p class="wp-block-paragraph"><strong>Step 1.</strong> Ensure the SSH port (default is 22) is accessible from your network.</p>



<p class="wp-block-paragraph"><strong>Step 2a.</strong> On a <strong>Linux</strong>/<strong>Mac</strong> workstation, do the following :</p>



<ul class="wp-block-list">
<li>Open your terminal.</li>
<li>Type the below command:</li>
</ul>



<pre class="wp-block-code has-cyan-bluish-gray-background-color has-background"><code>ssh -N -L anyport:127.0.0.1:8080 devel@your-server-ip </code></pre>



<ul class="wp-block-list">
<li>The <code>anyport </code>is literally any port you wish as long as it&#8217;s not being used. Port 8000 for example.</li>
<li>The command will seem to do nothing, but that is how it works. The tunnel is being established.</li>
</ul>



<p class="wp-block-paragraph"><strong>Step 2b.</strong> On a <strong>Windows</strong> workstation, do as follows:</p>



<ul class="wp-block-list">
<li>Download and Install <strong>PuTTY</strong></li>
<li>Start <strong>PuTTY</strong>, fill in your server IP address/hostname:</li>
</ul>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img decoding="async" class="wp-image-2752" src="https://serverstadium.com/wp-content/uploads/2022/10/image-2.png" alt="" width="339" height="332" srcset="https://serverstadium.com/wp-content/uploads/2022/10/image-2.png 452w, https://serverstadium.com/wp-content/uploads/2022/10/image-2-300x294.png 300w" sizes="(max-width: 339px) 100vw, 339px" />
<figcaption>PuTTY Session</figcaption>
</figure>
</div>


<ul class="wp-block-list">
<li>Then go to <strong>Connection &gt; SSH &gt; Tunnels</strong></li>
<li>On the <strong>Source port</strong> define your desired port, any port as long as it&#8217;s not being used yet. And in the <strong>Destination</strong> box, type <code>127.0.0.1:8080</code>. And finally, click <strong>Add</strong>.</li>
</ul>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" class="wp-image-2753" src="https://serverstadium.com/wp-content/uploads/2022/10/image-3.png" alt="" width="338" height="332" />
<figcaption>Tunnel setting in PuTTY</figcaption>
</figure>
</div>


<ul class="wp-block-list">
<li>Go back to the <strong>Session </strong>menu, give a name for the session and click <strong>Save</strong>. This way you can directly connect to this configuration in the future easily.</li>
</ul>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="297" height="234" class="wp-image-2755" src="https://serverstadium.com/wp-content/uploads/2022/10/image-4.png" alt="" />
<figcaption>Save Session</figcaption>
</figure>
</div>


<ul class="wp-block-list">
<li>Lastly, click<strong> Open </strong>to establish the tunnel.</li>
</ul>



<p class="wp-block-paragraph"><strong>Step 3.</strong> Open your browser and type <code>localhost:theport</code> replacing <code>theport</code> with the port, you previously defined when establishing the tunnel.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" class="wp-image-2758" src="https://serverstadium.com/wp-content/uploads/2022/10/image-7.png" alt="" width="986" height="443" srcset="https://serverstadium.com/wp-content/uploads/2022/10/image-7.png 1315w, https://serverstadium.com/wp-content/uploads/2022/10/image-7-300x135.png 300w, https://serverstadium.com/wp-content/uploads/2022/10/image-7-1024x459.png 1024w, https://serverstadium.com/wp-content/uploads/2022/10/image-7-768x345.png 768w" sizes="(max-width: 986px) 100vw, 986px" />
<figcaption>Accessing the VS Code</figcaption>
</figure>
</div>


<p class="wp-block-paragraph"><strong>Step 4.</strong> Put the password as you can find it in the file, then click Submit.</p>



<p class="wp-block-paragraph"><strong>Step 5.</strong> Happy coding!</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" class="wp-image-2759" src="https://serverstadium.com/wp-content/uploads/2022/10/image-8.png" alt="" width="988" height="479" srcset="https://serverstadium.com/wp-content/uploads/2022/10/image-8.png 1317w, https://serverstadium.com/wp-content/uploads/2022/10/image-8-300x146.png 300w, https://serverstadium.com/wp-content/uploads/2022/10/image-8-1024x497.png 1024w, https://serverstadium.com/wp-content/uploads/2022/10/image-8-768x373.png 768w" sizes="(max-width: 988px) 100vw, 988px" />
<figcaption>VS Code in the browser!</figcaption>
</figure>
</div>


<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Last words</h2>



<p class="wp-block-paragraph">If you wish to access it using a dedicated domain/subdomain you own (e.g. code.example.com), check out my other article on <a href="https://serverstadium.com/knowledge-base/reverse-proxy-management-using-nginx-proxy-manager/">Nginx Reverse Proxy</a>. That way, you can proxy and secure your VS Code server using SSL.</p>



<p class="wp-block-paragraph">The only thing you&#8217;ll need to change is the bind IP configuration in the <code>~/.config/code-server/config.yaml</code> then change it to your LAN IP (accessible from the NPM server).</p>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Conclusion</h2>



<p class="wp-block-paragraph">Installing VS Code (code-server) on a VM instance is so easy. Simply by running a designated oneliner command, it&#8217;s installed!</p>



<p class="wp-block-paragraph">Check other articles in our <strong><a href="https://serverstadium.com/knowledge-base/" target="_blank" rel="noreferrer noopener">Knowledge Base</a></strong> Or even better, you can try installing VS Code on ServerStadium&#8217;s VM by <a href="https://cp.serverstadium.com/regist-user" target="_blank" rel="noreferrer noopener"><strong>registering</strong> </a>here.</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/vs-code-on-your-browser-how-to-install-code-server-on-a-vm/">VS Code on your browser! How to install code-server on a VM</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
