Yes, swap the unsalted butter for coconut oil if you need a dairy-free cookie. Use expeller pressed or refined coconut oil if you don't want a coconut flavor in your cookies. (Melted or softened  coconut oil should work.)