Open source licenses are not allowed to discriminate against fields of endeavor. That means you cannot use an open source license for your code and use that license to prevent competitors from opening shop.
Some things that are possible with various open source licenses are:
The AGPL requires that modified versions must be under the AGPL license and their source code must be offered to those that receive the binary and those that interact with it over a network. That means that if a competitor uses and improves your software, you get to use those improvements as well in your hosting solution. This does not prevent competition, but any competitor must outbid you on marketing and/or the price/quality ratio of their subscription plan.
The Apache 2.0 license has a mechanism for giving attribution beyond the normal copyright notices (the NOTICES file). This mechanism could be used to direct people to your hosting solution as the "official" hosting solution.