You can find the relevant application pages for all types of grounds for EU residence on newtodenmark.dk.
An application page on newtodenmark.dk contains all the necessary information on how to apply for an EU residence document. Here you will also find the relevant application form, in addition to a step-by-step guide to successfully submit the application.
If you apply for EU residence in Denmark, your application will be processed by the Danish Agency for International Recruitment and Integration (SIRI).
You can also apply for an EU residence document at one of the International Citizen Service centres:
You need an EU residence document in order to get a civil registration number (CPR number).