Changing default port of eureka server using spring cloud

Try this configuration: 1. Server.

server:
  port: 8080

eureka:
  instance:
   hostname: localhost
client:
  registerWithEureka: false
  fetchRegistry: false
  serviceUrl:
  defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/

2. Client.

spring:
  application:
  name: eureka-client
server:
  port: 8083
eureka:
  client:
  registerWithEureka: true
  fetchRegistry: true
  serviceUrl:
    defaultZone: http://localhost:8080/eureka/