Compute shader usage without opening a window

Is it possible to use the compute shader without creating a window when using GLUT and GLEW? My understanding is you have to create a window using GLUT and only then can you initialize GLEW.

You need a device context for OpenGL to work since it is for rendering - so no. If you want a “compute shader” without a window use OpenCL that is what it is for.

Note that once you have created an OpenGL context, it is possible to create a windowless context from it with WGL/GLX_pbuffer. Then you can delete the original context and just use your windowless pbuffer context.