Research In Motion is testing a cloud-based music service around its BlackBerry Messenger, that it plans to offer commercially later this year.

A “closed beta trial” of the BBM Music service is starting Thursday in Canada, the U.S. and the U.K. The service is expected to be available later this year for a monthly subscription of about US$5 in 18 countries in Europe, Asia, and North America, RIM said on Thursday.

The service will not be available on RIM’s PlayBook tablet at this point, as it does not have the BBM application, a company spokesman said.

Reports last week said that the company was in negotiations with top music labels to offer the service.

RIM has tied up with Universal Music Group, Sony Music Entertainment, Warner Music Group, and EMI Group to offer the service which will allow users to build a “personal music profile” of up to 50 of their favorite songs on their phones, from a catalog of “millions of songs”.

Music can be cached to smart phones for offline listening, allowing users to access songs even when they don’t have wireless coverage, RIM said in a statement.

Users can refresh their profile and swap up to 25 songs each month, besides being allowed to share playlists or single songs with other users who are part of the program. Users need to have the BBM 6 version of the messenger running on their smart phones.

“If there are songs you love so much you’d like to purchase them, you can select the buy option and purchase directly from the Amazon MP3 Music Store”, RIM said in a blog post.

Users can see a visual timeline from within the BBM Music app that shows the recent updates of all users within their community, besides a chronological view of community updates, including who added new friends, which songs were added or removed, and which playlists were created and what comments were made by BBM Music friends, RIM said.

Omnifone, a cloud music service provider, is providing RIM with a back-end technology for the BBM Music service that includes content management, music hosting and reporting functions, RIM said.

The countries where RIM plans to launch the service commercially include Australia, Canada, Columbia, France, Germany, Indonesia, Italy, Malaysia, Mexico, Netherlands, Saudi Arabia, Singapore, Spain, Thailand, Turkey, UAE, the U.K. and the U.S. Pricing of the service may vary by country and will be announced upon its availability in each country, RIM said.