Guy friend and boyfriend

I’ve been in a pretty stable relationship for years and before going back to uni a guy has been messaging me and we met once with other uni friends. I’m fine being friends with this guy but I feel like I need to tell him I’m in a relationship so he doesn’t feel annoyed etc. We’ve only spoken on message for two weeks so I don’t know how/when to tell him, any ideas?