Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To run a website in Visual Studio Code, open its project folder, then either preview a static HTML file or start the project’s local development server and open its localhost address. Use a server for features that expect HTTP, such as JavaScript modules or fetch(). To debug in a browser, add a .vscode/launch.json configuration and press F5.

1. Open the website folder and find its entry point

  1. In desktop VS Code, select File > Open Folder and choose the folder containing your site.
  2. Find the page that should load first. For a simple static site, this is commonly index.html. Framework projects may instead define their entry point through a development script.
  3. Check that the HTML references files at their actual relative paths. For example, <link rel="stylesheet" href="css/site.css"> expects a css folder alongside the HTML file.

Open the project folder rather than an individual HTML file when possible. This gives VS Code a consistent workspace for relative paths, the integrated terminal, project configuration, and any .vscode settings.

2. Choose how to preview the site

The right method depends on what the page needs. A browser renders the website; VS Code edits the files and can open or debug the page.

Method Best for HTTP behavior and setup
Open an HTML file directly A basic page that uses local HTML, CSS, and JavaScript without server-dependent behavior Opens as a local file, typically with a file:// URL. No server setup.
VS Code integrated browser Opening a local HTML page or a running localhost site within VS Code VS Code’s integrated browser supports local .html and .htm files and localhost links; its documentation also covers opening Developer Tools. See Microsoft’s browser documentation.
Live Preview extension Convenient front-end preview in VS Code The Marketplace listing describes integrated-browser preview and the Live Preview: Show Debug Preview command. It is not a universal substitute for a framework’s own server. See the Live Preview listing.
Simple local HTTP server A static folder that needs HTTP rather than direct file access Run a server in the integrated terminal, then open its reported localhost URL. Microsoft’s Edge documentation gives npx http-server as an example when Node.js and npm are installed. See Microsoft’s example.
Framework development server React, Vue, Angular, Vite, Next.js, or another app with build tooling or server features Run the project’s documented script. The command and capabilities depend on the project.

Preview a static HTML file

For a straightforward page, open index.html in VS Code’s integrated browser or use a suitable preview extension. You can also open the file in a browser outside VS Code. Direct file preview is the simplest option, but it does not reproduce a site being served over HTTP.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
HP OmniBook 3 17.3 inch Laptop PC, FHD Display, AMD Ryzen 3 30, 8 GB RAM, 512 GB SSD, AMD Radeon 610M Graphics, Windows 11 Home, Mica Silver, 17-dp0199nr
  • FULL HD IPS DISPLAY - Enjoy vibrant, crystal-clear images with 178-degree wide-viewing angles
  • AMD RYZEN 3 30 PROCESSOR - Everyday performance you can count on; Multitask, stream, game casually, and edit photos smoothly with responsive power and vibrant HDR visuals
  • ENJOY UP TO 14 HOURS AND 15 MINUTES OF BATTERY LIFE - HP Fast Charge restores battery from 0 to 50% in approximately 45 minutes
  • AMD RADEON 610M GRAPHICS - Experience smooth entertainment; Built for streaming and multitasking, enjoy realistic visuals and efficient performance for work and play
  • STORAGE AND MEMORY - 512 GB PCIe NVMe M.2 SSD offers fast speed and efficient storage; and 8 GB LPDDR5 RAM memory boosts performance with higher bandwidth

Start a simple HTTP server

If you have Node.js and npm installed and only need to serve a static folder, open View > Terminal and run:

npx http-server

When prompted, allow npm to run the package. Read the terminal output for the address and port, then open the displayed http://localhost:<port> URL in the integrated browser or another browser. The port may vary; use the address the server actually reports rather than assuming a particular one.

Run a framework project

For a framework-based site, inspect its README and package.json scripts. From View > Terminal, run the project’s documented development command in the appropriate folder. There is no one command that starts every React, Vue, Angular, Vite, or Next.js project. Once the server prints a localhost URL, open that exact URL in a browser.

Rank #2
HP 14" HD Chromebook Laptop for Students, Intel Quad-Core N4120(> N4020), 4GB RAM, 64GB eMMC, WiFi, Webcam, HDMI, USB-A&C, 14 Hours Battery Life, Zoom, Chrome OS, CUE Accessories
  • Intel Celeron N4120: 4 Cores & Threads, 1.1GHz Base Clock, Up to 2.6GHz Boost Clock, 4MB Cache, Intel UHD Graphics 600. The perfect combination of performance, power consumption, and value helps your device handle multitasking smoothly and reliably with four processing cores to divide up the work.
  • 14" HD Display: 14.0-inch diagonal, HD (1366 x 768), micro-edge, anti-glare. See your digital world in a whole new way. Enjoy movies and photos with the great image quality and high-definition detail of 1 million pixels.
  • Memory & Storage: 4 GB LPDDR4x & 64 GB eMMC Storage. Adequate high-bandwidth RAM to smoothly run multiple applications and browser tabs all at once. An embedded multimedia card provides reliable flash-based storage.
  • Ports:2 x USB 3.0 Type-A,1 x USB 3.0 Type-C,1 x HDMI,1 x Headphone Jack
  • Chrome OS: Chromebook is a computer for the way the modern world works, with thousands of apps. Enjoy the seamless simplicity that comes with Google Chrome and Android apps, all integrated into one laptop. It’s fast, simple, and secure.

If the app depends on environment variables, a database, an API proxy, or other services, follow the project’s setup instructions too. A running development server does not automatically provide services the project expects but that you have not configured.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

3. Know when a local server is necessary

Direct file preview can work for simple pages, but a local HTTP server is safer when the site uses browser features or URL behavior that expects an origin and HTTP requests.

  • fetch() requests: browser security rules can prevent or change requests made from a file:// page.
  • JavaScript ES modules: module loading may fail when a page is opened directly as a file.
  • Client-side routes: routes such as /about may need server fallback behavior so refreshing a nested URL still serves the app.
  • Server or proxy routes: a front-end preview alone does not run an API server or configure the framework’s development proxy.

If you see a CORS or module-loading error on a file:// page, try the project’s development server or another local HTTP server. Serving over localhost is a common fix for this class of issue, though it does not resolve every API, proxy, or server configuration problem.

Rank #3
Sale
AKCHART 15.6'' AI Laptop with Office 365 12GB RAM 256GB SSD Win 11 Laptops
  • Stunning 15.6" FHD IPS Display: Experience crisp 1920x1080 resolution on this 15.6 inch laptop with an IPS panel that delivers wide viewing angles and vivid colors. The narrow-bezel design maximizes screen real estate for comfortable viewing on this Win 11 laptop, whether you're studying or working.
  • Celeron J4105 Processor & 256GB SSD: Powered by a reliable Celeron J4105 processor paired with 12GB DDR4 memory and a fast 256GB M.2 SSD. This laptop computer supports SSD expansion up to 2TB and TF card expansion up to 1TB, so your storage grows with your needs. Delivers smooth multitasking for daily productivity.
  • AI-Powered Win 11 Laptop: Built-in AI features enhance your productivity with smart assistance for writing, summarizing, and task management. Pre-installed with Win 11 and includes Office 365 subscription. This student laptop is backed by 1-year warranty and 24/7 customer support.
  • All-Day 7000mAh Battery & 180° Hinge: The high-capacity 7000mAh battery keeps this laptop powered through long classes or meetings. The 180-degree lay-flat hinge lets you share your screen effortlessly during presentations. This durable laptop computer adapts to your dynamic workflow.
  • Versatile Connectivity Hub: Equipped with USB 3.2, Type-C, Mini HDMI, and 3.5mm audio jack to connect all your peripherals. Stay online anywhere with high-speed 5G WiFi and Bluetooth 4.2. This college laptop keeps you connected at home, in the library, or on the go.

4. Debug the page in a browser

VS Code includes built-in debugging for Edge and Chrome. You can open a link for debugging, launch a URL from a configuration, or debug a local file. Microsoft’s debugging guide explains the available workflows.

  1. Start the site’s server if the page needs HTTP.
  2. In VS Code, open the Command Palette and select Debug: Open Link, or use Run and Debug with a launch configuration.
  3. Set breakpoints in your JavaScript by clicking beside a line number.
  4. Use the browser’s Console to inspect runtime errors and the Network panel to check whether scripts, stylesheets, images, or API requests loaded.

When a bundler generates source maps, check that their paths resolve to the source files if breakpoints do not bind where expected. The integrated browser’s Developer Tools can help inspect a page without leaving VS Code. Details on the integrated browser.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

5. Make F5 launch the local site

To reuse the same browser-and-URL setup, create .vscode/launch.json in the project folder. Replace the sample URL with the actual address from your server.

Rank #4
HP Essential Laptop 2026, Intel CPU, 128GB Storage, Office 365, Windows 11
  • Efficient Performance for Everyday Computing: Powered by Intel N150 processor with up to 3.6 GHz Intel Turbo Boost Technology, 6 MB L3 cache, 4 cores, and 4 threads, this HP laptop delivers responsive performance for web browsing, streaming, document editing, and multitasking. Paired with 4GB LPDDR5 RAM and 128GB UFS storage, it handles daily tasks smoothly. Includes 1-year Microsoft 365 Personal subscription for Word, Excel, PowerPoint, and cloud storage to maximize your productivity.
  • 14-Inch HD Micro-Edge Display:Enjoy clear visuals on the 14-inch HD (1366 x 768) anti-glare screen with 250-nit brightness and 62.5% sRGB coverage. The micro-edge bezel delivers a 79% screen-to-body ratio in a compact design. An HP True Vision 720p HD camera with noise reduction and dual-array microphones supports clear video calls, remote work, and online learning.
  • Modern Connectivity and Wireless Technology: Stay connected with Wi-Fi 6 (2x2) for faster wireless speeds and Bluetooth 5.4 for seamless pairing with accessories. Versatile port selection includes 1 USB Type-C 10Gbps with DisplayPort 1.2 for external displays, 2 USB Type-A 5Gbps ports for peripherals, 1 HDMI 1.4b port, 1 headphone/microphone combo jack, and 1 multi-format SD media card reader. Connect monitors, transfer files quickly, and expand your workspace with ease.
  • All-Day Battery Life and Portable Design: Enjoy up to 11 hours of video playback, 7.5 hours of mixed usage, or 7.5 hours of wireless streaming on a single charge, perfect for students and professionals on the go. Weighing just 3.24 lb and measuring 12.76" x 8.86" x 0.71", this lightweight laptop fits easily in backpacks and bags. The stylish willow green top cover with matte finish and natural silver keyboard deck with vertical brushing pattern offer a modern, professional look.
  • AI-Enhanced Productivity: Access Microsoft Copilot instantly with the dedicated Copilot key for faster assistance. AI Noise Reduction filters background sounds and improves voice clarity during calls. Dual speakers provide clear audio, while the full-size natural silver keyboard and HP Imagepad support comfortable typing and navigation.
{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "msedge",
      "request": "launch",
      "name": "Launch local site",
      "url": "http://localhost:8000"
    }
  ]
}

Save the file, start your server, then press F5 or choose the configuration in Run and Debug. If using Chrome, replace msedge with chrome; to use VS Code’s integrated browser, use editor-browser. These configurations and options are described in Microsoft’s browser-debugging documentation.

The sample uses port 8000 only as an example. If your server reports another port, update the URL. The browser launch configuration opens the page; it does not start an arbitrary framework server for you. Start that server separately unless your project has a configured task or other workflow to do so.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

6. If you use VS Code for the Web

VS Code for the Web is useful for editing in a browser, but its official documentation says the browser-based editor does not provide a terminal or debugger. If running, building, or debugging the project requires those capabilities, use desktop VS Code, GitHub Codespaces, or Remote Tunnels as appropriate. Read Microsoft’s VS Code for the Web documentation.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Sale
15.6 Inch Laptop with FHD display, 6GB RAM 128GB Storage Expandable 512GB
  • Portable Lightweight Design: Weighing just 3.6 lbs, the Laptop S7HI is portable, making it perfect for travel, work, and school. Its slim profile and 15-inch HD IPS display offer a great balance of size and portability for everyday use
  • Powerful Processor: With a base frequency 1.9GHz Intel 5205U processor, this laptop handles multiple tasks efficiently. Whether you're working, studying, or streaming, enjoy a smooth experience with reliable performance
  • Ample Storage with Expansion: 128GB of internal storage with an extra 512GB expansion slot offers plenty of room for your documents, photos, and videos. Ideal for students and professionals needing more space for files and projects
  • Pre‑Installed Windows 11: Ready to Use Comes with a genuine Windows 11 system pre‑loaded, offering a clean, intuitive interface and broad software compatibility. Open the box, power on, and you're all set for school assignments, business reports, or daily computing needs.
  • Comprehensive Connectivity Options: Equipped with Type-C, HDMI, SD Card Reader, and more, this laptop offers flexible connectivity. Stay connected via dual-band WiFi and Bluetooth 4.2, ensuring fast internet access and peripheral support

7. Fix common run and preview problems

Symptom Likely cause What to check or do
Blank page Wrong entry page, a failed script, or an incorrect asset path Confirm you opened the intended HTML file or localhost route. Inspect the browser Console and Network panel for errors.
CSS, JavaScript, or images are missing A path or filename does not match the project files Check paths relative to the HTML file, directory names, and filename letter case. A path that works on one case-insensitive filesystem may fail elsewhere.
CORS or module error from a local file The page is opened using file://, but its requests or module loading expect HTTP Start the project’s development server or a local HTTP server and open its localhost address.
Port is already in use Another process is listening on the server’s chosen port Stop the old server if you can, or configure the server to use another port. Update launch.json to match the new address.
F5 opens the wrong page or fails The launch URL may use a stale port, or the selected browser debugger may not be available Compare launch.json with the server’s actual URL and check the browser type in the configuration.
Framework route works until refresh The development server may not be configured to serve the app for nested client-side routes Use the framework’s development server and consult its routing or server setup instructions.
Cannot run the project in vscode.dev The browser-based editor lacks a terminal and debugger Move the workflow to desktop VS Code, Codespaces, or Remote Tunnels if it needs runtime or debugging access.

Or skip the browser setup

If you need a screenshot rather than an interactive local preview, ScreenshotNeo is a website screenshot API and MCP server. Its one-call endpoint captures a URL as an image or PDF; it does not run the website project on your computer or replace local development and debugging.

For example, request a public page with cURL:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

Replace YOUR_API_KEY with your key and change the target URL as needed. See the ScreenshotNeo API documentation for request options and response details.

  • Cookie and consent banners are accepted like a visitor, and 60+ known consent platforms, newsletter popups, and chat widgets are removed before capture; each step can be turned off.
  • Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing; response headers identify the page verdict and whether the request was billed.
  • An MCP server provides take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients.
  • The Free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000 screenshots.

Sign up for ScreenshotNeo’s free plan to get 1,000 screenshots a month with no card.

Frequently Asked Questions

Can VS Code itself run a website?

VS Code edits and can preview or debug a site, but the browser renders it. HTTP-dependent sites also need a local server.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Can I use Live Preview instead of a framework development server?

It can provide convenient front-end preview, but it is not a universal replacement for a framework server, API, or proxy configuration.

Does F5 start my development server?

The example launch configuration opens a browser at the configured URL. Start your project’s server separately unless you have configured a workflow to launch it.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.