Best way to make a door system?

I was wondering what would be the best way yo go about making a door system? Should I have it work on the server or client? I heard that having something like this on the server would have some lag due to server lag, but I am not sure how to go about setting it up on the client. If someone could help me, that would be great!

Depending.

There are cases where you’d want only the client to see door opening for him.

There are cases where you’d want to let everyone see it.

In my game, all of the code is on the server. I also use a for loop to move it.