VSCode SSH Remote Dev Port Forwarding

I just got VSCode's remote development working with a linode through SSH. I created a blank sveltekit project and have it running with npm run dev. The dev server starts, vscode says it's forwarding 5173:5173 but when trying to navigate to localhost:5173 it just sits there spinning. No errors or anything to go off of. Has anyone experienced this or know of something else that needs setup on the server for it to work correctly? I'm like so close yet so far away from this actually working all the way through. I really appreciate any help in advance.

1 Reply

Although I personally haven't tested it, this video walks through the port-forwarding process using VS Code if you're already connected to your remote host via SSH.

You'll want to make sure port 5173 is not blocked by a firewall when start up the dev server. You can do this by running the following command from your terminal:

nmap -Pn -p 5173 <your.ip.address>

If you're unfamiliar with the nmap command this post titled How do I understand the results of an nmap scan? has more info.

You can also just run the dev server from a normal terminal SSH connection to see if that works. If it does, you know that it's an issue with VS Code and you can troubleshoot from there. If you get stuck, you can always post a question to Stack Overflow and give it the tag visual studio code.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct