Before you start
What is a remote web server?
In IntelliJ IDEA, any server with the document root outside the current project is called remote. This server may be actually running on a physically remote host or on your machine.
For example, if your project is in C:/IntelliJ IDEAProjects/MyProject and the web server document root is C:/XAMPP/htdocs, for IntelliJ IDEA this web server is remote.
How do I synchronize my application sources on the server with their local copies in my IntelliJ IDEA project?
To debug an application on a remote web server, you need to have the copies of its sources in a IntelliJ IDEA project. To synchronize local and remote sources, create a deployment configuration as described in Create a remote server configuration and Configure synchronization with a Web server.
Debugging an application on a remote server
Click OK to save the configuration settings.
Choose the newly created configuration in the Select run/debug configuration list on the toolbar and click Debug . The HTML file specified in the run configuration opens in the chosen browser and the Debug tool window appears.
Suppose you have a simple application that consists of an index.html file and an App.js file, where index.html references App.js.
Let's now deploy our simple application to a local web server, see Deploy your application. In this example it is Apache:
Specify the URL you are running your application at:
In our example, the local project structure and file structure on the server are the same so no mappings are required.
Now we can start debugging: choose the new run/debug configuration from the list in the upper right-hand corner of the IntelliJ IDEA window, and then click to the right of the list:
Mappings set correspondence between files on a web server and their local copies. You need mappings:
When your application is deployed and running on a remote web server.
When you have defined several resource root folders in addition to the project root.
In most cases, IntelliJ IDEA sets path mappings automatically by reusing mappings from the deployment configuration. If your application structure is complicated, additional manual configuration is required.
In the Remote URLs of local files area, map the files and folders to URL addresses of files and folders on the server according to the currently used deployment configuration, see Mapping local folders to folders on the server and the URL addresses to access them.