How did Ravana get Lanka?

Golden Lanka first belonged to Kubera, the god of wealth, and Ravana's half-brother.
Armed with Brahma's boon, Ravana demanded the city. Their father advised Kubera to give it up, rather than fight his own brother.
Kubera left, and Ravana crowned himself king of Lanka.
Even that was not enough. He attacked Kubera again, and took his flying chariot, the Pushpaka.
Source: Valmiki Ramayana. Episodes found only in later retellings are marked as such.