On line.
If you are getting a Real Id for the first time you'll need to go in person. If you're just renewing a Real Id or regular driver's license you may just be able to do it online. If you did it online last time you needed to renew, you'll likely need to go in. You can figure it out one way or the other here: https://www.mass.gov/how-to/renew-your-drivers-license
Thanks! Your answer is awaiting moderation.