To define a server in IntelliJ IDEA, in most of the cases, all you have to do is to specify where the corresponding server is installed. For hosted server systems (Cloud Foundry or CloudBees), you should specify your user account details instead.
You can define a server separately in the Settings dialog. You can also define a server when creating a project or adding a module to an existing project. Finally, you can define a server at a later time, when creating an application server run/debug configuration.
Note that if you specify the server that you are going to use when creating a project or module, IntelliJ IDEA will create a run/debug configuration for the corresponding server. (Otherwise, you'll have to do it yourself.) So it's recommended that you define the necessary server before or when creating a project or module.
- Defining a server in the Settings dialog
- Defining a server when creating a project or module
- Defining a server when creating a run/debug configuration
- Open the Settings dialog (e.g. ).
- In the left-hand pane, under IDE Settings, click Application Servers.
- On the Application Servers page that opens in the right-hand part of the dialog, click . (Alternatively, press or or or or .)
- Select the server that you are going to use from the list.
- In the dialog that opens, specify the server settings and click OK. (For most of the servers, you have to specify just the server installation directory (referred to as the server home). For hosted server systems (Cloud Foundry or CloudBees), you should specify your user account details.) For more information, see Application Servers.
- Click OK in the Settings dialog.
- Start creating a project or module from scratch (e.g. File | New Project or File | New Module). See also, Creating a Project from Scratch or Creating a Module from Scratch.
- On the first page of the wizard, select Java Module. Specify other settings as necessary and click Next. For more information, see Creating a Java Module.
- On the second page of the wizard (the Technologies page), in the left-hand pane, select Application Server.
- Use the list in the right-hand part of the page to define a "new server" or to select a server whose definition already exists in IntelliJ IDEA. (The options that start with New are for defining "new servers". For example, if Tomcat is not yet defined in IntelliJ IDEA and you want to add its definition now, select New Tomcat Server and specify its installation directory in the field that appears underneath the list.)
- If necessary, select the technologies and frameworks that you want to use, specify the associated settings and click Finish to complete the wizard.
- Open the Run/Debug Configurations dialog (e.g. Run | Edit Configurations).
- Click ( or or or or ), select the server of interest (e.g. Tomcat Server) and, if available, select Local or Remote.
- In the right-hand part of the dialog, on the Server tab, click Configure to the right of the Application server list.
- In the dialog that opens specify the server settings and click OK.
- Specify other run/debug configuration settings as necessary and click OK.