> For the complete documentation index, see [llms.txt](https://reyvaleza.gitbook.io/vibe.d-tutorial/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://reyvaleza.gitbook.io/vibe.d-tutorial/the-default-hello-world-app.md).

# The default hello world app

In the terminal window, go to your folder of choice or create a new one, for example **c:\vibeprojects**. Inside that folder, type the command

**dub init hello --type=vibe.d**

or

**dub init hello -t vibe.d**

And press **Enter** at every prompt that follows to accept the defaults.

c:\vibeprojects>**dub init hello -t vibe.d**

```
Select a package recipe format:
1) sdl    2) json   
#? [2]: 
Name [hello]: 
Description [A simple vibe.d server application.]: 
Author name [rey]: 
Select or enter an SPDX license-identifier (https://spdx.org/licenses/):
 1) BSL-1.0 (Boost)               8) BSD-                         
 2) MIT                           9) MPL- (Mozilla)               
 3) Unlicense (public domain)    10) EUPL-                        
 4) Apache-                      11) CC- (Creative Commons)       
 5) AGPL-                        12) Zlib                         
 6) GPL-                         13) ISC                          
 7) LGPL-                        14) proprietary                  
? [14]: 
Copyright string [Copyright © 2026, rey]: 
Add dependency (leave empty to skip) []: 
     Success created empty project in /home/rey/vibe/hello
             Package successfully created in hello

```

Go inside the newly created **hello** project folder and explore it.

c:\vibeprojects>**cd hello**\
c:\vibeprojects\hello>**dir**

```
 Volume in drive C has no label.
 Volume Serial Number is 4E0A-BFEF
 Directory of c:\vibeprojects\hello
2026-06-04  01:30 PM    <DIR>          .
2026-06-04  01:30 PM    <DIR>          ..
2026-06-04  01:30 PM               131 .gitignore
2026-06-04  01:30 PM               215 dub.json
2026-06-04  01:30 PM    <DIR>          public
2026-06-04  01:30 PM    <DIR>          source
2026-06-04  01:30 PM    <DIR>          views
               2 File(s)            346 bytes
               5 Dir(s)  134,991,044,608 bytes free
```

You are now inside the root directory of the hello application. To compile and run this application in one step (you haven’t done anything yet!), type

**dub**

Since this is the first time you will be running this command, this will download all the dependencies, then compile, then link, and then run the application.

*c:\vibeprojects\hello>***dub**

There will be a lot of messages before you see this at the tail end:

```
     Linking hello
    Finished To force a rebuild of up-to-date targets, run again with --force
     Running hello 
Listening for requests on http://[::1]:8080/
Listening for requests on http://127.0.0.1:8080/
Please open http://127.0.0.1:8080/ in your browser.
```

The last three lines indicate that the application has successfully compiled and the server is now running.

Open your browser and point it to localhost, port 8080.

[http://127.0.0.1:8080](https://www.google.com/url?q=http://127.0.0.1:8080/\&sa=D\&source=editors\&ust=1676218018092712\&usg=AOvVaw0Md_Ifsolo71nWwXe2RnQN)&#x20;

or

[http://localhost:8080](https://www.google.com/url?q=http://localhost:8080/\&sa=D\&source=editors\&ust=1676218018093592\&usg=AOvVaw1YnTEfdHOzE3T2BB_4X1iT)

and you will see the ‘Hello, World!’ message in your browser.

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

To stop the running application, press **Ctrl-C** (Control-C) on the terminal window. Sometimes you have to do it twice.

```
^CReceived signal 2. Shutting down.
Stopped to listen for HTTP requests on ::1:8080
Stopped to listen for HTTP requests on 127.0.0.1:8080
```

The common command options for **dub** are

dub init         - create a new project

dub run        - build and run combined

dub                - same as dub run

dub build       - compile the whole project and its dependencies but don’t run

dub test        - runs the unit tests

Let us take a closer look at the default application.

Open VS Code and go to *File->Open folder…*&#x20;

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

Then open the new application folder **hello**.

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

In the Explorer window of VS Code, open **source\app.d** and you will see the automatically generated code.

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

```d
import vibe.vibe;

void main()
{
	auto settings = new HTTPServerSettings;
	settings.port = 8080;
	settings.bindAddresses = ["::1", "127.0.0.1"];
	auto listener = listenHTTP(settings, &hello);
	scope (exit)
	{
		listener.stopListening();
	}

	logInfo("Please open http://127.0.0.1:8080/ in your browser.");
	runApplication();
}

void hello(HTTPServerRequest req, HTTPServerResponse res)
{
	res.writeBody("Hello, World!");
}
```

In the **main()** method of **source\app.d**:

* a new HTTPServerSettings object is created
* the HTTP port number is set to 8080 (which you can change)
* the IP the server listens to is set to localhost in both IPv6 (“::1”) and IPv4 (“127.0.0.1”) format
* the listenHTTP(settings, \&hello) call means ‘run the hello() function using these settings’
* the runApplication() call starts the ball rolling (starts the event loop)
