Technically, it's perfectly legal to install your own security system without getting a home alarm permit. However, activating and operating the system is another matter. If you're planning on any kind of remote monitoring or emergency response features, many local governments require you to have an alarm permit. And even without any monitoring, a loud alarm can result in fines if you don't have the proper alarm permit.
A home alarm permit is mandatory for residents of many major cities and counties, mainly to address the issue of false alarms. Many of the laws date back a decade or more, when home security systems and monitoring services were less sophisticated and homeowners less familiar with them.
Some localities have a single alarm permit, regardless of the type of alarm, while others make a distinction between fire, police or combined fire and police alarm permits. For example, if you only have a monitored smoke detector, you may only need the fire alarm permit. If you have a complete monitored security system (including smoke detectors), you may need a single permit that covers everything, or separate fire and police alarm permits if there is no combined option.
Alarm permits are granted on either a one-time basis or subject to yearly renewal, depending on local laws. A waiver may be given in a few circumstances, such as if you're over a certain age (a "senior waiver") or if your security system is not connected to a monitoring service. Keep in mind, however, that the noise from an unmonitored home security system's alarm may bring a police response. If it turns out to be a false alarm, you may face a larger fine if you don't have an alarm permit.
Don't confuse home alarm permits with alarm licenses. Alarm permits, if they're required, cover your personal use of a home alarm system, while an alarm license is what professional alarm installers may need to obtain from a local (typically state) agency before starting any work. Homeowners almost never need a license to install their own systems, although it's always a good idea to check local construction, zoning and homeowner association rules before you begin any major DIY projects.
Where applicable, alarm permits are typically issued by city or county government offices rather than state or federal agencies. You'll most often submit your alarm permit application to the appropriate local Department of Finance, Department of Public Safety or Sheriff's Department. Generally, the website of your local police or fire department should have information about alarm permits, sometimes including downloadable forms and contact info.