This website (https://international.kk.dk/cpr-number) clearly states a condition for officially becoming a resident in Denmark and getting a CPR number is that you have an actual residence, a place to live.
Something I have noticed in Denmark, Sweden, and Germany, is that it is often reflected as extremely important, by various administrative procedures, that you live in a “real” form of housing, like an apartment or a house. It is not at all easy to just casually declare some address as your own, or a PO Box. It must be a dwelling the government considers official in all ways, not just meeting various habitability codes, but also I think an address that in general has a kind of residential “zoning”, like some addresses are simply not even considered residential, regardless of what’s actually there.
The part that makes this seem like a regrettable bureaucracy is that in all of these three countries, the converse is true for maintaining residence status: matters of citizenship, criminal activity, deportation and so on aside, there is (I think) basically no formal concept of needing to maintain your residence status. Basically, the second the government has accepted your residence application at some address, you could immediately move out and become homeless for the next ten years, but you will have officially gotten your foot in the door, and will be entitled to all of the rights of someone residing in that country. But before that initial registration happens, the opposite, where you are barred from a number of civil services and provisions because you’re basically just a foreigner, visitor or illegal alien there.
It seems that this type of law is far more geared towards a certain practical effect then it is meant to have a particular intrinsic meaning, an actual necessary condition for some reason. They just need to make it slightly hard for anyone in the world to move there unrestricted and self-declare as residents.
But given how trivial one’s evasion of that condition can be - I have registered at a hostel I spent a month at and have not been there in several months; I can easily register with a friend on a whim, who simply says “mi casa es tu casa” even though I maybe have never even set foot inside of their home - it opens the genuinely important question to me of whether people should ultimately have the legal right to declare themselves a resident of a certain country, under certain conditions, without needing to have a specific home, address or apartment that you live at.
I think it’s very important because it is a fundamental and natural human right to not have to pay money to spend time inside of a building every night. You absolutely have the right to be “homeless”, to sleep on the ground, in a van, to camp, to be a drifter, to move around from place to place.
So, is there any legal avenue for a person to declare residence in Denmark, openly communicating that they do not have any home or personal address? For example, could there be any claim to fulfilling the essential role of a resident but who simply asserts their right to be a part of Denmark without having to have a home? Is there any even tiny legal opening for such an idea? And if not, isn’t that a pretty major violation of human rights, that it’s effectively illegal to not pay money to live inside of an apartment, that it mandatorily costs money just to have a place to sleep at night, that you have to pay money just for being alive?