If you make sure you care for a coffee plant, it'll do just fine indoors. They won't grow as fast, and remain a much more compact tree.  You'll also need to provide enough light, water well and prune aggressively. If you care for your coffee plant well, it can live for 25 years or more.