# How to run as background process?

Exiting the IDE window does not terminate the container, but it does terminate the process running in the terminal. To avoid this, you should run it as a **background process**.

There are 2 options to set-up;&#x20;

1. Run in the background setting (recommanded!)
2. Use `nohup` command

### 1. Run in the background setting

Enter the execution command in the script, then tap the **Run in the background** checkbox to run the command.

command tap > Run > click right on wanted run command > setting > **check Run in the backgound** > Save and run&#x20;

<figure><img src="/files/ZRRC6QaNZrzs9AcREXHW" alt=""><figcaption></figcaption></figure>

### 2. Use `nohup` command

#### 1. How to run

* Prepare a file(ex. a.out) that you want to run in a background process.&#x20;
* Type the command

```
# nohup <absolute path>/a.out &
```

* You can check for execution with the command below.

```
 # ps -aux | grep a.out
```

####

#### 2. How to end

* After finding the PID value with the `ps` command, end the process with the `kill` command.

```
# ps -ef | grep a.out
# kill -TERM PID number
```

**※ Note:** `nohup` command automatically creates a file called nohup.out.

This file records the output of the commands you run with `nohup.`&#x20;

If you don't want to create this file, you can have it output to /dev/null.

```
# nohup echo hello > /dev/null
```

### If you are using node app&#x20;

**You can simply run it as a background process using the `forever` command in the npm package.**

#### 1. How to run

* Install `forever`

```
$ npm install -g forever
```

* Run the app with the command below

```
$ forever start app.js
```

* You can verify whether it's running or not with the command below.

```
$ forever list
```

For detailed usage, please refer to **forever usage**.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.goorm.io/en/goormide/07.-faq/how-to-run-as-background-process.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
