GoLand 2024.1 Help

Create a local server configuration

A local server is a server that runs in a local or mounted folder and serves files to a local URL address. In a local server configuration, you do the development in a GoLand project, and then upload the project files to the document root on the server.

To create a local server configuration in GoLand, you need to set up connection between GoLand and the server and configure mapping between the GoLand project and the project folder on the server and its corresponding URL path.

Local or mounted server configuration

1. Specify the name, type, and visibility of a server configuration

  1. Press Ctrl+Alt+S to open the IDE settings and then select Build, Execution, Deployment | Deployment.

    Alternatively, go to Tools | Deployment | Configuration... in the main menu.

  2. In the left-hand pane that lists all the existing server configurations, click Add Add item and select Local or mounted folder in the popup menu.

    Add local or mounted folder
  3. In the Create new server dialog that opens, type the name of the server to create and click OK. The Create new server dialog closes and you return to the Connection tab of the Deployment node.

  4. Click the Use as default button on the toolbar to mark the server as default.

  5. Clear the Visible only for this project checkbox to enable reuse of this server access configuration in other projects.

2. Set up connection to the server

In the Connection tab (Ctrl+Alt+S | Build, Execution, Deployment | Deployment), specify the server settings:

  • Folder: specify the absolute path to the server document root as defined in your server configuration file. Besides the document root itself, any other existing folder under the document root can also be specified.

    The document root is the folder from which the web server serves files to the web server URL.

  • Web server URL: the URL address (hostname and (optionally) port) mapped to the server document root in the server configuration file. This is the base URL for your application's web address. Both HTTP and the HTTPS protocols are supported.

    Click Browse in the right-hand corner of the field to open and check the provided web server URL.

Local or mounted server configuration

3. Map project folder to a server folder and URL path

In the Mappings tab (Ctrl+Alt+S | Build, Execution, Deployment | Deployment), specify the mapping between the project opened in GoLand and the folder under the server document root that shall correspond to it:

  • Local path: the absolute path to the local project folder. GoLand automatically fills out this field with the path to the currently opened project.

  • Deployment path: a folder under the server document root where GoLand will upload the contents of the project folder specified in the Local path field.

    If a folder with the specified name does not exist yet, GoLand will create it when you trigger project upload.

    The easiest way is to map the entire project root folder to a folder under the server document root. The project folder structure in this case will be recreated on the server.

  • Web path: the URL path to the folder specified in Deployment path. In most cases, it's the same as the value provided in the Deployment path field or a slash (/) pointing to the root folder.

Local or mounted server mappings
Last modified: 15 April 2024