Setting Up Eureka Server Using Spring Cloud (Part 1)

This is a quick example for setting up Eureka server using Spring Cloud.

You can download the whole project by using following link.

For this tutorial, we will be creating a New Maven Project. To keep thing more simple we will be creating a simple maven project i.e. we will be skipping archetype selection.

New Maven Project Wizard – Creating a simple project

This post is a part of the following series.

  1. Part 1 – Setting Up Eureka Server Using Spring Cloud
  2. Part 2 – Developing a Eureka client and registering it with Eureka Server.
  3. Part 3 – Developing Eureka client and consuming service exposed by another Eureka client.

Just fill in the requisite Group Id and Artifact Id on next screen and we are good to go.

New Maven Project Wizard – Configuring project

You will need to create only two files ‘’ and ‘’ for this project. You may refer to the following directory structure for their respective locations.

Project Structure

Replace content in pom.xml file with following content

<project xmlns=""

		<relativePath /> <!-- lookup parent from repository -->



Looking for Eureka server built using Spring cloud 1.5.18.RELEASE/ Edgware.SR5 version? You can copy its pom.xml from this post.

Under resources folder create a file with name ‘‘ and add the following content

Create file ‘‘ and add the following content

package com.example.demo;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

public class AsmEurekaApplication {

	public static void main(String[] args) {, args);

That’s all. The magic annotation @EnableEurekaServer will do rest everything for you.

Now just run as Java application and Eureka server should start on port 11800. You can open the eureka server dashboard by navigating to http://localhost:11800 from your browser.

Eureka Server Dashboard


Further Reading: has a four-part series explaining how to develop, register and discover micro-services using Eureka.

  1. Part 1 Develop an Eureka server using Spring Boot and register an application to it
  2. Part 2 Develop microservices with REST APIs for producing and consuming.
  3. Part 3 Develop Eureka Server Microservice and register the employee-producer code to it.
  4. Part 4 Develop Eureka Server Microservice and use discovery service for employee-consumer.

Another great explanation Spring Cloud Netflix – Eureka at Baeldung and Spring Cloud Service Discovery with Netflix Eureka at HowToDoInJava. You should check both of those.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.