A derived algebraic geometric study of classical \(\textrm{GL}_n\) -Yang-Mills theory on the 2-dimensional square lattice \({\mathbb {Z}}^2\) is presented. The derived critical locus of the Wilson action is described and its local data supported in rectangular subsets \(V =[a,b]\times [c,d]\subseteq {\mathbb {Z}}^2\) with both sides of length \(\ge 2\) is extracted. A locally constant dg-category-valued prefactorization algebra on \({\mathbb {Z}}^2\) is constructed from the dg-categories of quasi-coherent complexes on the derived stacks of local data.