Vision-based fish counting plays a vital role in monitoring breeding density, optimizing feeding strategies, and planning marketing schedules in deep-sea aquaculture. However, large-scale variations in fish and nonuniform background illumination in underwater images make it challenging to accurately count fish in deep-sea cages. Aiming to solve these issues, this study proposes a deep neural network (DNN) with local-global context aggregation and self-distillation called LGSDNet for fish counting and density estimation in deep-sea aquaculture. First, a local-global context aggregation module (LGCAM) is designed to aggregate the dense local multiscale context and global context in images, enabling the network to capture robust feature representations for fish with various scales under various background illumination conditions. Then, a self-distillation module (SDM) is designed to leverage information from the deep layers of the network to guide the learning of the shallow layers, enhancing the representation learning of the network without increasing the inference time. Extensive comparative experiments on the fish counting dataset collected from a deep-sea cage demonstrate the effectiveness of LGSDNet. It achieves a mean absolute error (MAE) of 5.68, a root-mean-squared error (RMSE) of 7.38, and a mean absolute percentage error (MAPE) of 3.27%, outperforming the Baseline with a reduction in the aforementioned metrics by 6.75, 7.92, and 3.42%, respectively. In addition, LGSDNet outperforms state-of-the-art fish and crowd counting methods on the dataset while having only 13.03 M parameters. Generalization experiments further demonstrate the adaptability of LGSDNet to diverse aquaculture environments.