I see you’re using Plots.jl, and “GKS” sounds like the GR backend. In that case, set the magic environmental variable
ENV["GKSwstype"] = "100"
which tells it to operate in “headless” mode where it doesn’t expect an active display connected. (AFAIK this is undocumented but it’s super useful!).