This applies to a German citizien. In case you are not a German citizien changes may apply:
You want to go on a longer trip and therefore cancel your contracts in Germany? Since I also had to deal with this before my world trip, I would like to share my experiences here. In the end, there is nothing more unnecessary than to go on a world trip and continue to have financial obligations in Germany. Because electricity, internet and the health insurance do not necessarily make it easy to disclose the necessary information for the special right of termination. But in the end it is very easy to make use of the special right of termination.